AC_HAVE_SYNC_FILE_RANGE
AC_HAVE_BLKID_TOPO($enable_blkid)
+AC_CHECK_SIZEOF([long])
+AC_CHECK_SIZEOF([char *])
AC_TYPE_PSINT
AC_TYPE_PSUNSIGNED
AC_TYPE_U32
-AC_SIZEOF_POINTERS_AND_LONG
AC_MANUAL_FORMAT
AC_CONFIG_FILES([include/builddefs])
#include <pthread.h>
#include <ctype.h>
#include <sys/types.h>
+#include <limits.h>
#undef HAVE___U32
#ifdef HAVE___U32
#endif
/* long and pointer must be either 32 bit or 64 bit */
-#undef HAVE_32BIT_LONG
-#undef HAVE_64BIT_LONG
-#undef HAVE_32BIT_PTR
-#undef HAVE_64BIT_PTR
-
-#if defined(HAVE_32BIT_LONG)
-# define BITS_PER_LONG 32
-#elif defined(HAVE_64BIT_LONG)
-# define BITS_PER_LONG 64
-#else
-# error Unknown long size
-#endif
+#undef SIZEOF_LONG
+#undef SIZEOF_CHAR_P
+#define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT)
/* Check if __psint_t is set to something meaningful */
#undef HAVE___PSINT_T
#ifndef HAVE___PSINT_T
-# ifdef HAVE_32BIT_PTR
+# if (SIZEOF_CHAR_P * CHAR_BIT) == 32
typedef int __psint_t;
-# elif defined HAVE_64BIT_PTR
-# ifdef HAVE_64BIT_LONG
+# elif (SIZEOF_CHAR_P * CHAR_BIT) == 64
+# if BITS_PER_LONG == 64
typedef long __psint_t;
# else
/* This is a very strange architecture, which has 64 bit pointers but */
/* Check if __psunsigned_t is set to something meaningful */
#undef HAVE___PSUNSIGNED_T
#ifndef HAVE___PSUNSIGNED_T
-# ifdef HAVE_32BIT_PTR
+# if (SIZEOF_CHAR_P * CHAR_BIT) == 32
typedef unsigned int __psunsigned_t;
-# elif defined HAVE_64BIT_PTR
-# ifdef HAVE_64BIT_LONG
+# elif (SIZEOF_CHAR_P * CHAR_BIT) == 64
+# if BITS_PER_LONG == 64
typedef long __psunsigned_t;
# else
/* This is a very strange architecture, which has 64 bit pointers but */
__u32 u32;
], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
])
-
-#
-# Check type sizes
-#
-AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
- [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
- AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
- fi
- AC_CHECK_SIZEOF(long, 4)
- AC_CHECK_SIZEOF(char *, 4)
- if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then
- AC_DEFINE(HAVE_32BIT_LONG)
- fi
- if test $ac_cv_sizeof_long -eq 8; then
- AC_DEFINE(HAVE_64BIT_LONG)
- fi
- if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then
- AC_DEFINE(HAVE_32BIT_PTR)
- fi
- if test $ac_cv_sizeof_char_p -eq 8; then
- AC_DEFINE(HAVE_64BIT_PTR)
- fi
- ])