summaryrefslogtreecommitdiff
path: root/build/apr_common.m4
diff options
context:
space:
mode:
authordavi <davi@13f79535-47bb-0310-9956-ffa450edef68>2007-07-10 14:39:03 +0000
committerdavi <davi@13f79535-47bb-0310-9956-ffa450edef68>2007-07-10 14:39:03 +0000
commit068d5136d2ab18fca435f3e8ca25b61cd78e7bc5 (patch)
treec8d60aee463cca5495c334fc48a5bfafca365437 /build/apr_common.m4
parent70738e7f53f36f5828e49143d48f8db221f7c83f (diff)
downloadlibapr-068d5136d2ab18fca435f3e8ca25b61cd78e7bc5.tar.gz
Improve detection of the printf format identifiers for apr_ssize_t and apr_size_t
using the gcc (and icc) built-in __builtin_types_compatible_p (used to determine if two types are the same). This could also be achieved with another gcc extension (type redeclaration), but using the built-in seems more forward compatible. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@554963 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/apr_common.m4')
-rw-r--r--build/apr_common.m414
1 files changed, 14 insertions, 0 deletions
diff --git a/build/apr_common.m4 b/build/apr_common.m4
index 1c17591ec..1b2b15947 100644
--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -959,3 +959,17 @@ fi
AC_SUBST(MKDEP)
])
+
+dnl
+dnl APR_CHECK_TYPES_COMPATIBLE(TYPE-1, TYPE-2, [ACTION-IF-TRUE])
+dnl
+dnl Try to determine whether two types are the same. Only works
+dnl for gcc and icc.
+dnl
+AC_DEFUN([APR_CHECK_TYPES_COMPATIBLE], [
+define([apr_cvname], apr_cv_typematch_[]translit([$1], [ ], [_])_[]translit([$2], [ ], [_]))
+AC_CACHE_CHECK([whether $1 and $2 are the same], apr_cvname, [
+AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [
+ int foo[0 - !__builtin_types_compatible_p($1, $2)];
+], [apr_cvname=yes $3], [apr_cvname=no])])
+])