[pkg-opensc-commit] [pkcs11-helper] 37/60: gcc vararg macro detection
Eric Dorland
eric at moszumanska.debian.org
Fri Jan 6 23:39:44 UTC 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to tag pkcs11-helper-1.02
in repository pkcs11-helper.
commit 9eb3dc160d4be3de97bfa5fc2c8842ea94a9860b
Author: alonbl <alonbl at 485eb718-1723-0410-b8a9-88cf21a28c35>
Date: Thu Dec 14 10:00:46 2006 +0000
gcc vararg macro detection
---
acinclude.m4 | 43 +++++++++++++++++++++++++++++++++++++++++++
configure.ac | 2 ++
2 files changed, 45 insertions(+)
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..fb8b4a7
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,43 @@
+dnl @synopsis AX_CPP_VARARG_MACRO_GCC
+dnl
+dnl Test if the preprocessor understands GNU GCC-style vararg macros.
+dnl If it does, defines HAVE_CPP_VARARG_MACRO_GCC to 1.
+dnl
+dnl @version
+dnl @author James Yonan <jim at yonan.net>, Matthias Andree <matthias.andree at web.de>
+AC_DEFUN([AX_CPP_VARARG_MACRO_GCC], [dnl
+ AS_VAR_PUSHDEF([VAR],[ax_cv_cpp_vararg_macro_gcc])dnl
+ AC_CACHE_CHECK([for GNU GCC vararg macro support], VAR, [dnl
+ AC_COMPILE_IFELSE([
+ #define macro(a, b...) func(a, b)
+ int func(int a, int b, int c);
+ int test() { return macro(1, 2, 3); }
+ ], [ VAR=yes ], [VAR=no])])
+ if test $VAR = yes ; then
+ AC_DEFINE([HAVE_CPP_VARARG_MACRO_GCC], 1,
+ [Define to 1 if your compiler supports GNU GCC-style variadic macros])
+ fi
+ AS_VAR_POPDEF([VAR])dnl
+])
+
+dnl @synopsis AX_CPP_VARARG_MACRO_ISO
+dnl
+dnl Test if the preprocessor understands ISO C 1999 vararg macros.
+dnl If it does, defines HAVE_CPP_VARARG_MACRO_ISO to 1.
+dnl
+dnl @version
+dnl @author James Yonan <jim at yonan.net>, Matthias Andree <matthias.andree at web.de>
+AC_DEFUN([AX_CPP_VARARG_MACRO_ISO], [dnl
+ AS_VAR_PUSHDEF([VAR],[ax_cv_cpp_vararg_macro_iso])dnl
+ AC_CACHE_CHECK([for ISO C 1999 vararg macro support], VAR, [dnl
+ AC_COMPILE_IFELSE([
+#define macro(a, ...) func(a, __VA_ARGS__)
+ int func(int a, int b, int c);
+ int test() { return macro(1, 2, 3); }
+ ], [ VAR=yes ], [VAR=no])])
+ if test $VAR = yes ; then
+ AC_DEFINE([HAVE_CPP_VARARG_MACRO_ISO], 1,
+ [Define to 1 if your compiler supports ISO C99 variadic macros])
+ fi
+ AS_VAR_POPDEF([VAR])dnl
+])
diff --git a/configure.ac b/configure.ac
index ebeb994..f35dde1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -259,6 +259,8 @@ fi
# Checks for header files.
AC_HEADER_STDC
+AX_CPP_VARARG_MACRO_ISO
+AX_CPP_VARARG_MACRO_GCC
AC_C_CONST
AC_C_VOLATILE
AC_TYPE_OFF_T
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/pkcs11-helper.git
More information about the pkg-opensc-commit
mailing list