diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/SIZEOF_OFF_T.h b/libbuild2-autoconf/libbuild2/autoconf/checks/SIZEOF_OFF_T.h index a7eac23..17f49ef 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/SIZEOF_OFF_T.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/SIZEOF_OFF_T.h @@ -2,13 +2,18 @@ #undef SIZEOF_OFF_T -/* Note that the _FILE_OFFSET_BITS macro is expected to be defined by the + +/* Use __SIZEOF_SIZE_T__ (defined by GCC and Clang and maybe others) to detect + * a 64-bit target. + * + * Note that the _FILE_OFFSET_BITS macro is expected to be defined by the * user, for example, on the command line. */ #ifdef _MSC_VER # define SIZEOF_OFF_T 4 -#elif defined(__x86_64__) || defined(__ppc64__) || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) +#elif (defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 8) || \ + (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) # define SIZEOF_OFF_T 8 #else # define SIZEOF_OFF_T 4