From 1b1bbd0ddc30dc95d69bf3cc4ba1218f1b60c6f0 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 28 May 2001 15:41:24 +0000 Subject: [PATCH] Check for __VARARGS__ separately for C and C++. Mon May 28 11:40:34 2001 Owen Taylor * configure.in: Check for __VARARGS__ separately for C and C++. --- ChangeLog | 4 ++++ ChangeLog.pre-2-0 | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-12 | 4 ++++ ChangeLog.pre-2-2 | 4 ++++ ChangeLog.pre-2-4 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ configure.in | 41 ++++++++++++++++++++++++++++++++++------- 9 files changed, 66 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28e908db..2d3ae8a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon May 28 11:40:34 2001 Owen Taylor + + * configure.in: Check for __VARARGS__ separately for C and C++. + 2001-05-28 Sebastian Wilhelmi * configure.in: Fix typo. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 28e908db..2d3ae8a8 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,7 @@ +Mon May 28 11:40:34 2001 Owen Taylor + + * configure.in: Check for __VARARGS__ separately for C and C++. + 2001-05-28 Sebastian Wilhelmi * configure.in: Fix typo. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 28e908db..2d3ae8a8 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +Mon May 28 11:40:34 2001 Owen Taylor + + * configure.in: Check for __VARARGS__ separately for C and C++. + 2001-05-28 Sebastian Wilhelmi * configure.in: Fix typo. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 28e908db..2d3ae8a8 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,7 @@ +Mon May 28 11:40:34 2001 Owen Taylor + + * configure.in: Check for __VARARGS__ separately for C and C++. + 2001-05-28 Sebastian Wilhelmi * configure.in: Fix typo. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 28e908db..2d3ae8a8 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,7 @@ +Mon May 28 11:40:34 2001 Owen Taylor + + * configure.in: Check for __VARARGS__ separately for C and C++. + 2001-05-28 Sebastian Wilhelmi * configure.in: Fix typo. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 28e908db..2d3ae8a8 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +Mon May 28 11:40:34 2001 Owen Taylor + + * configure.in: Check for __VARARGS__ separately for C and C++. + 2001-05-28 Sebastian Wilhelmi * configure.in: Fix typo. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 28e908db..2d3ae8a8 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +Mon May 28 11:40:34 2001 Owen Taylor + + * configure.in: Check for __VARARGS__ separately for C and C++. + 2001-05-28 Sebastian Wilhelmi * configure.in: Fix typo. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 28e908db..2d3ae8a8 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +Mon May 28 11:40:34 2001 Owen Taylor + + * configure.in: Check for __VARARGS__ separately for C and C++. + 2001-05-28 Sebastian Wilhelmi * configure.in: Fix typo. diff --git a/configure.in b/configure.in index 825f354f..2de7bec7 100644 --- a/configure.in +++ b/configure.in @@ -136,6 +136,7 @@ fi dnl Checks for programs. AC_PROG_CC +AC_PROG_CXX AM_PROG_CC_STDC AC_PROG_INSTALL @@ -377,13 +378,28 @@ xyes) AC_DEFINE(G_HAVE_INLINE,1,[Have inline keyword]) esac # check for flavours of varargs macros -AC_MSG_CHECKING(for ISO C99 varargs macros) +AC_MSG_CHECKING(for ISO C99 varargs macros in C) AC_TRY_COMPILE([],[ int a(int p1, int p2, int p3); #define call_a(...) a(1,__VA_ARGS__) call_a(2,3); -],g_have_iso_varargs=yes,g_have_iso_varargs=no) -AC_MSG_RESULT($g_have_iso_varargs) +],g_have_iso_c_varargs=yes,g_have_iso_c_varargs=no) +AC_MSG_RESULT($g_have_iso_c_varargs) + +AC_MSG_CHECKING(for ISO C99 varargs macros in C++) +if test $CXX = gcc ; then +dnl No C++ compiler + g_have_iso_cxx_varargs=no +else + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([],[ +int a(int p1, int p2, int p3); +#define call_a(...) a(1,__VA_ARGS__) +call_a(2,3); +],g_have_iso_cxx_varargs=yes,g_have_iso_cxx_varargs=no) + AC_LANG_C +fi +AC_MSG_RESULT($g_have_iso_cxx_varargs) AC_MSG_CHECKING(for GNUC varargs macros) AC_TRY_COMPILE([],[ @@ -1644,12 +1660,23 @@ $glib_inline #endif /* !__cplusplus */ _______EOF - if test x$g_have_iso_varargs = xyes ; then + if test x$g_have_iso_c_varargs = xyes ; then cat >>$outfile <<_______EOF -#define G_HAVE_ISO_VARARGS 1 +#define G_HAVE_ISO_C_VARARGS 1 _______EOF fi + if test x$g_have_iso_cxx_varargs = xyes ; then + cat >>$outfile <<_______EOF + +#define G_HAVE_ISO_CXX_VARARGS 1 +_______EOF + fi + cat >>$outfile <<_______EOF + +#define G_HAVE_ISO_VARARGS (defined(__cplusplus) ? defined(G_HAVE_ISO_CXX_VARARGS) : defined(G_HAVE_ISO_C_VARARGS)) +_______EOF + if test x$g_have_gnuc_varargs = xyes ; then cat >>$outfile <<_______EOF @@ -1657,7 +1684,6 @@ _______EOF _______EOF fi - echo >>$outfile if test x$g_have_eilseq = xno; then cat >>$outfile <<_______EOF @@ -1939,7 +1965,8 @@ if test x$glib_cv_has__inline__ = xyes; then fi g_have_gnuc_varargs=$g_have_gnuc_varargs -g_have_iso_varargs=$g_have_iso_varargs +g_have_iso_c_varargs=$g_have_iso_c_varargs +g_have_iso_cxx_varargs=$g_have_iso_cxx_varargs case xyes in x$ac_cv_c_bigendian) -- 2.34.1