summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2011-11-16 03:16:29 +0100
committerGuillem Jover <guillem@debian.org>2011-11-16 04:28:42 +0100
commit1f4d0354fc4a8c80c6463b9aaebd93822247341b (patch)
tree35a58d304c4fbfaefc9767a95ac5719b8254dce8 /m4
parent68a6242098c4b9330d1e5b49a8fea14547cec1aa (diff)
downloaddpkg-1f4d0354fc4a8c80c6463b9aaebd93822247341b.tar.gz
build: Map the BSD u_intN_t types to C99 uintN_t if not defined
The md5 module imported from OpenBSD is using these BSD types, but those are not present on at least Solaris. Define them to their corresponding C99 types, so that the imported code has to be modified as less as possible. Reported-by: Andrew Stormont <andrew.stormont@nexenta.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/dpkg-types.m423
1 files changed, 22 insertions, 1 deletions
diff --git a/m4/dpkg-types.m4 b/m4/dpkg-types.m4
index c3b380d1f..ba227010e 100644
--- a/m4/dpkg-types.m4
+++ b/m4/dpkg-types.m4
@@ -1,5 +1,5 @@
# Copyright © 2005 Scott James Remnant <scott@netsplit.com>
-# Copyright © 2009 Guillem Jover <guillem@debian.org>
+# Copyright © 2009-2011 Guillem Jover <guillem@debian.org>
# DPKG_TYPE_PTRDIFF_T
# -------------------
@@ -10,6 +10,27 @@ AC_DEFUN([DPKG_TYPE_PTRDIFF_T],
[Define to 'int' if <malloc.h> does not define.]))dnl
])# DPKG_TYPE_PTRDIFF_T
+# DPKG_TYPE_U_INT_T(N)
+# --------------------
+# Check for u_intN_t BSD type, defining to C99 type if not.
+AC_DEFUN([DPKG_TYPE_U_INT_T],
+[
+ AC_CHECK_TYPE([u_int$1_t], [],
+ AC_DEFINE_UNQUOTED([u_int$1_t], [uint$1_t],
+ [Define to 'uint$1_t' if not defined.]))
+])
+
+# DPKG_TYPES_U_INT_T
+# ------------------
+# Check for u_int(8|16|32|64)_t BSD types, defining to C99 types if not.
+AC_DEFUN([DPKG_TYPES_U_INT_T],
+[
+ DPKG_TYPE_U_INT_T([8])
+ DPKG_TYPE_U_INT_T([16])
+ DPKG_TYPE_U_INT_T([32])
+ DPKG_TYPE_U_INT_T([64])
+])
+
# DPKG_DECL_SYS_SIGLIST
# ---------------------
# Check for the sys_siglist variable in either signal.h or unistd.h