Skip to content

Commit beaede0

Browse files
committed
Expanded macro for definition of dim_t
1 parent b46af83 commit beaede0

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

include/af/defines.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636
#define SIZE_T_FRMT_SPECIFIER "%zu"
3737
#endif
3838

39-
// Windows 64-bit has long long as 64-bit int type (long is 32-bit) following LLP64
40-
// All other 64 bit OS have long and long long as 64-bit int type following LP64
41-
// All 32-bit OS have long as 32-bit int type
42-
#if defined(_WIN64)
39+
// Known 64-bit x86 and ARM architectures use long long
40+
#if defined(__x86_64__) || defined(_M_X64) || defined(_WIN64) || defined(__aarch64__) // 64-bit Architectures
4341
typedef long long dim_t;
42+
// Known 32-bit x86 and ARM architectures use int
43+
#elif defined(__i386__) || defined(_M_IX86) || defined(__arm__) || defined(_M_ARM) // 32-bit x86 Architecture
44+
typedef int dim_t;
45+
// All other platforms use long long
4446
#else
45-
typedef long dim_t;
47+
typedef long long dim_t;
4648
#endif
4749

4850
#ifdef __cplusplus

0 commit comments

Comments
 (0)