AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(size_t)
AC_SYS_LARGEFILE
* We could use bits_required64() unconditionally, but that's unnecessary
* and way more heavy weight on 32-bit systems.
*/
-#ifdef _LP64
+#if SIZEOF_SIZE_T > 4
#define BITS_REQUIRED(x) bits_required64(x)
#else
#define BITS_REQUIRED(x) bits_required32(x)
#ifndef COMPAT_H
#define COMPAT_H
-/*
- *
- *
- *
- * This block decides whether 32 or 64 bit pointers are used.
- * Shallow research indicates, that ILP32 is used for x32 and arm64ilp32 modes
- * but is it still necessary?
- * https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models
- *
- *
- *
- */
-/* _ILP32 and _LP64 are common but not universal, make sure that exactly one
- of them is defined. */
-#if !defined(_ILP32) && \
- (SIZEOF_INT == 4) && (SIZEOF_LONG == 4) && (SIZEOF_VOID_P == 4)
-# define _ILP32
-#endif
-#if !defined(_LP64) && \
- (SIZEOF_INT == 4) && (SIZEOF_LONG == 8) && (SIZEOF_VOID_P == 8)
-# define _LP64
-#endif
-#if defined(_ILP32) && defined(_LP64)
-# error "Cannot have both _ILP32 and _LP64 defined"
-#elif !defined(_ILP32) && !defined(_LP64)
-# error "Must have one of _ILP32 and _LP64 defined"
-#endif
-
#if defined(HAVE_TYPEOF) && !defined(__cplusplus)
# define HAVE_TYPE_CHECKS
#endif
(void)p_malloc(pool, POOL_MAX_ALLOC_SIZE + 1ULL);
return FATAL_TEST_FAILURE;
-#ifdef _LP64 /* malloc(POOL_MAX_ALLOC_SIZE) may succeed with 32bit */
+#if SIZEOF_SIZE_T > 4 /* malloc(POOL_MAX_ALLOC_SIZE) may succeed with 32bit */
case 2: /* physically impossible size */
test_expect_fatal_string("Out of memory");
(void)p_malloc(pool, POOL_MAX_ALLOC_SIZE);
(void)p_malloc(pool, POOL_MAX_ALLOC_SIZE + 1ULL);
return FATAL_TEST_FAILURE;
-#ifdef _LP64 /* malloc(POOL_MAX_ALLOC_SIZE) may succeed with 32bit */
+#if SIZEOF_SIZE_T > 4 /* malloc(POOL_MAX_ALLOC_SIZE) may succeed with 32bit */
case 2: /* physically impossible size */
test_expect_fatal_string("Out of memory");
(void)p_malloc(pool, POOL_MAX_ALLOC_SIZE);
#define BIG_MAX POOL_MAX_ALLOC_SIZE
-#if defined(_LP64)
+#if SIZEOF_SIZE_T > 4
#define LITTLE_MAX ((unsigned long long) INT32_MAX)
#else
#define LITTLE_MAX ((unsigned long long) INT16_MAX)