summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorBrendan Cully <brendan@kublai.com>2005-01-31 02:40:14 +0000
committerBrendan Cully <brendan@kublai.com>2005-01-31 02:40:14 +0000
commit33f3234ee5b91091eacc3a2898cc68304da8790f (patch)
tree79d7b7ee2cd28d57311eed37c9c99b4b37a87844 /m4
parentd443d8fba27a2fff89b65a71f8014e97ca32bd28 (diff)
Begin removing deprecated autoconf 2.13 backward compatibility code.
Add AC_CHECK_TYPES macros for uin32/64 types, use uint64_t instead of long long in hcache code.
Diffstat (limited to 'm4')
-rw-r--r--m4/types.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/m4/types.m4 b/m4/types.m4
new file mode 100644
index 00000000..5f219fbf
--- /dev/null
+++ b/m4/types.m4
@@ -0,0 +1,36 @@
+dnl types.m4
+dnl macros for type checks not covered by autoconf
+
+dnl MUTT_C99_INTTYPES
+dnl Brendan Cully
+dnl
+# MUTT_C99_INTTYPES
+# Check for C99 integer type definitions, or define if missing
+AC_DEFUN([MUTT_C99_INTTYPES],
+[dnl
+AC_CHECK_HEADERS([inttypes.h])
+AC_CHECK_TYPE([uint32_t],
+ [AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])],
+ [AC_CHECK_SIZEOF(short)
+ AC_CHECK_SIZEOF(int)
+ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(long long)])
+AH_VERBATIM([X_HAVE_C99_INTTYPES],
+ [#ifndef HAVE_C99_INTTYPES
+# if SIZEOF_SHORT == 4
+typedef unsigned short uint32_t;
+# elif SIZEOF_INT == 4
+typedef unsigned int uint32_t;
+# elif SIZEOF_LONG == 4
+typedef unsigned long uint32_t;
+# endif
+# if SIZEOF_INT == 8
+typedef unsigned int uint64_t;
+# elif SIZEOF_LONG == 8
+typedef unsigned long uint64_t;
+# elif SIZEOF_LONG_LONG == 8
+typedef unsigned long long uint64_t;
+# endif
+#endif
+ ])
+])