From 2062ab7e57753ec3474e077ae93bf5abc4bcb7d6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 4 Sep 2022 10:18:57 +0200 Subject: [PATCH] Redo SIZEOF_OFF_T using __SIZEOF_SIZE_T__ instead of checking for CPUs --- .../libbuild2/autoconf/checks/SIZEOF_OFF_T.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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