Check for __VARARGS__ separately for C and C++.
authorOwen Taylor <otaylor@redhat.com>
Mon, 28 May 2001 15:41:24 +0000 (15:41 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 28 May 2001 15:41:24 +0000 (15:41 +0000)
Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>

* configure.in: Check for __VARARGS__ separately for C and C++.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in

index 28e908d..2d3ae8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in: Check for __VARARGS__ separately for C and C++.
+
 2001-05-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * configure.in: Fix typo.
index 28e908d..2d3ae8a 100644 (file)
@@ -1,3 +1,7 @@
+Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in: Check for __VARARGS__ separately for C and C++.
+
 2001-05-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * configure.in: Fix typo.
index 28e908d..2d3ae8a 100644 (file)
@@ -1,3 +1,7 @@
+Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in: Check for __VARARGS__ separately for C and C++.
+
 2001-05-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * configure.in: Fix typo.
index 28e908d..2d3ae8a 100644 (file)
@@ -1,3 +1,7 @@
+Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in: Check for __VARARGS__ separately for C and C++.
+
 2001-05-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * configure.in: Fix typo.
index 28e908d..2d3ae8a 100644 (file)
@@ -1,3 +1,7 @@
+Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in: Check for __VARARGS__ separately for C and C++.
+
 2001-05-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * configure.in: Fix typo.
index 28e908d..2d3ae8a 100644 (file)
@@ -1,3 +1,7 @@
+Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in: Check for __VARARGS__ separately for C and C++.
+
 2001-05-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * configure.in: Fix typo.
index 28e908d..2d3ae8a 100644 (file)
@@ -1,3 +1,7 @@
+Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in: Check for __VARARGS__ separately for C and C++.
+
 2001-05-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * configure.in: Fix typo.
index 28e908d..2d3ae8a 100644 (file)
@@ -1,3 +1,7 @@
+Mon May 28 11:40:34 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in: Check for __VARARGS__ separately for C and C++.
+
 2001-05-28  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * configure.in: Fix typo.
index 825f354..2de7bec 100644 (file)
@@ -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)