Use compile checks for ISO C99 and GNU extension varargs macros syntax and
authorOwen Taylor <otaylor@redhat.com>
Fri, 18 May 2001 16:00:54 +0000 (16:00 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 18 May 2001 16:00:54 +0000 (16:00 +0000)
Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>

* configure.in gmessages.h: Use compile checks for ISO C99 and GNU
extension varargs macros syntax and store result in glibconfig.h
(G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
on checking predefined macros.

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
glib/gmessages.h
gmessages.h

index 637a1b7..6b38961 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in gmessages.h: Use compile checks for ISO C99 and GNU
+       extension varargs macros syntax and store result in glibconfig.h
+       (G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
+       on checking predefined macros.
+
 2001-05-18  Michael Natterer  <mitch@convergence.de>
 
        * gmarkup.c: don't g_strdup()/g_free() all parsed attributes and
@@ -60,7 +67,7 @@ Sun May 13 10:31:17 2001  Owen Taylor  <otaylor@redhat.com>
 
 Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>
 
-       * gmessages.c (g_log_write_prefix): Avoid using stderr
+       * gmessages.c (g_log_write_prefix): Avoid using stdio
        to be as robust as possible in out-of-memory.
 
        * gmessages.c (g_log_default_handler): Remove some dead
index 637a1b7..6b38961 100644 (file)
@@ -1,3 +1,10 @@
+Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in gmessages.h: Use compile checks for ISO C99 and GNU
+       extension varargs macros syntax and store result in glibconfig.h
+       (G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
+       on checking predefined macros.
+
 2001-05-18  Michael Natterer  <mitch@convergence.de>
 
        * gmarkup.c: don't g_strdup()/g_free() all parsed attributes and
@@ -60,7 +67,7 @@ Sun May 13 10:31:17 2001  Owen Taylor  <otaylor@redhat.com>
 
 Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>
 
-       * gmessages.c (g_log_write_prefix): Avoid using stderr
+       * gmessages.c (g_log_write_prefix): Avoid using stdio
        to be as robust as possible in out-of-memory.
 
        * gmessages.c (g_log_default_handler): Remove some dead
index 637a1b7..6b38961 100644 (file)
@@ -1,3 +1,10 @@
+Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in gmessages.h: Use compile checks for ISO C99 and GNU
+       extension varargs macros syntax and store result in glibconfig.h
+       (G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
+       on checking predefined macros.
+
 2001-05-18  Michael Natterer  <mitch@convergence.de>
 
        * gmarkup.c: don't g_strdup()/g_free() all parsed attributes and
@@ -60,7 +67,7 @@ Sun May 13 10:31:17 2001  Owen Taylor  <otaylor@redhat.com>
 
 Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>
 
-       * gmessages.c (g_log_write_prefix): Avoid using stderr
+       * gmessages.c (g_log_write_prefix): Avoid using stdio
        to be as robust as possible in out-of-memory.
 
        * gmessages.c (g_log_default_handler): Remove some dead
index 637a1b7..6b38961 100644 (file)
@@ -1,3 +1,10 @@
+Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in gmessages.h: Use compile checks for ISO C99 and GNU
+       extension varargs macros syntax and store result in glibconfig.h
+       (G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
+       on checking predefined macros.
+
 2001-05-18  Michael Natterer  <mitch@convergence.de>
 
        * gmarkup.c: don't g_strdup()/g_free() all parsed attributes and
@@ -60,7 +67,7 @@ Sun May 13 10:31:17 2001  Owen Taylor  <otaylor@redhat.com>
 
 Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>
 
-       * gmessages.c (g_log_write_prefix): Avoid using stderr
+       * gmessages.c (g_log_write_prefix): Avoid using stdio
        to be as robust as possible in out-of-memory.
 
        * gmessages.c (g_log_default_handler): Remove some dead
index 637a1b7..6b38961 100644 (file)
@@ -1,3 +1,10 @@
+Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in gmessages.h: Use compile checks for ISO C99 and GNU
+       extension varargs macros syntax and store result in glibconfig.h
+       (G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
+       on checking predefined macros.
+
 2001-05-18  Michael Natterer  <mitch@convergence.de>
 
        * gmarkup.c: don't g_strdup()/g_free() all parsed attributes and
@@ -60,7 +67,7 @@ Sun May 13 10:31:17 2001  Owen Taylor  <otaylor@redhat.com>
 
 Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>
 
-       * gmessages.c (g_log_write_prefix): Avoid using stderr
+       * gmessages.c (g_log_write_prefix): Avoid using stdio
        to be as robust as possible in out-of-memory.
 
        * gmessages.c (g_log_default_handler): Remove some dead
index 637a1b7..6b38961 100644 (file)
@@ -1,3 +1,10 @@
+Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in gmessages.h: Use compile checks for ISO C99 and GNU
+       extension varargs macros syntax and store result in glibconfig.h
+       (G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
+       on checking predefined macros.
+
 2001-05-18  Michael Natterer  <mitch@convergence.de>
 
        * gmarkup.c: don't g_strdup()/g_free() all parsed attributes and
@@ -60,7 +67,7 @@ Sun May 13 10:31:17 2001  Owen Taylor  <otaylor@redhat.com>
 
 Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>
 
-       * gmessages.c (g_log_write_prefix): Avoid using stderr
+       * gmessages.c (g_log_write_prefix): Avoid using stdio
        to be as robust as possible in out-of-memory.
 
        * gmessages.c (g_log_default_handler): Remove some dead
index 637a1b7..6b38961 100644 (file)
@@ -1,3 +1,10 @@
+Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in gmessages.h: Use compile checks for ISO C99 and GNU
+       extension varargs macros syntax and store result in glibconfig.h
+       (G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
+       on checking predefined macros.
+
 2001-05-18  Michael Natterer  <mitch@convergence.de>
 
        * gmarkup.c: don't g_strdup()/g_free() all parsed attributes and
@@ -60,7 +67,7 @@ Sun May 13 10:31:17 2001  Owen Taylor  <otaylor@redhat.com>
 
 Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>
 
-       * gmessages.c (g_log_write_prefix): Avoid using stderr
+       * gmessages.c (g_log_write_prefix): Avoid using stdio
        to be as robust as possible in out-of-memory.
 
        * gmessages.c (g_log_default_handler): Remove some dead
index 637a1b7..6b38961 100644 (file)
@@ -1,3 +1,10 @@
+Fri May 18 10:52:23 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * configure.in gmessages.h: Use compile checks for ISO C99 and GNU
+       extension varargs macros syntax and store result in glibconfig.h
+       (G_HAVE_ISO_VARARGS, G_HAVE_GNUC_VARARGS) rather than relying
+       on checking predefined macros.
+
 2001-05-18  Michael Natterer  <mitch@convergence.de>
 
        * gmarkup.c: don't g_strdup()/g_free() all parsed attributes and
@@ -60,7 +67,7 @@ Sun May 13 10:31:17 2001  Owen Taylor  <otaylor@redhat.com>
 
 Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>
 
-       * gmessages.c (g_log_write_prefix): Avoid using stderr
+       * gmessages.c (g_log_write_prefix): Avoid using stdio
        to be as robust as possible in out-of-memory.
 
        * gmessages.c (g_log_default_handler): Remove some dead
index 3f4f488..e2f6b2f 100644 (file)
@@ -376,6 +376,23 @@ case x$glib_cv_hasinline in
 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_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)
+
+AC_MSG_CHECKING(for GNUC varargs macros)
+AC_TRY_COMPILE([],[
+int a(int p1, int p2, int p3);
+#define call_a(params...) a(1,params)
+call_a(2,3);
+],g_have_gnuc_varargs=yes,g_have_gnuc_varargs=no)
+AC_MSG_RESULT($g_have_gnuc_varargs)
+
 # check for bytesex stuff
 AC_C_BIGENDIAN
 
@@ -1627,6 +1644,20 @@ $glib_inline
 #endif /* !__cplusplus */
 _______EOF
 
+       if test x$g_have_iso_varargs ; then
+               cat >>$outfile <<_______EOF
+
+#define G_HAVE_ISO_VARARGS
+_______EOF
+       fi
+       if test x$g_have_gnuc_varargs ; then
+               cat >>$outfile <<_______EOF
+
+#define G_HAVE_GNUC_VARARGS
+_______EOF
+       fi
+
+
        echo >>$outfile
        if test x$g_have_eilseq = xno; then
                cat >>$outfile <<_______EOF
@@ -1907,6 +1938,9 @@ if test x$glib_cv_has__inline__ = xyes; then
 #define G_HAVE___INLINE__ 1"
 fi
 
+g_have_gnuc_varargs=$g_have_gnuc_varargs
+g_have_iso_varargs=$g_have_iso_varargs
+
 case xyes in
 x$ac_cv_c_bigendian)
   g_byte_order=G_BIG_ENDIAN
index aa10eaf..817957d 100644 (file)
@@ -97,7 +97,7 @@ GLogLevelFlags  g_log_set_always_fatal  (GLogLevelFlags  fatal_mask);
 #ifndef G_LOG_DOMAIN
 #define G_LOG_DOMAIN    ((gchar*) 0)
 #endif  /* G_LOG_DOMAIN */
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#ifdef G_HAVE_ISO_VARARGS
 #define g_error(...)    g_log (G_LOG_DOMAIN,         \
                                G_LOG_LEVEL_ERROR,    \
                                __VA_ARGS__)
@@ -110,7 +110,7 @@ GLogLevelFlags  g_log_set_always_fatal  (GLogLevelFlags  fatal_mask);
 #define g_warning(...)  g_log (G_LOG_DOMAIN,         \
                                G_LOG_LEVEL_WARNING,  \
                                __VA_ARGS__)
-#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)
+#elif defined(G_HAVE_GNUC_VARARGS)
 #define g_error(format...)      g_log (G_LOG_DOMAIN,         \
                                        G_LOG_LEVEL_ERROR,    \
                                        format)
@@ -123,7 +123,7 @@ GLogLevelFlags  g_log_set_always_fatal  (GLogLevelFlags  fatal_mask);
 #define g_warning(format...)    g_log (G_LOG_DOMAIN,         \
                                        G_LOG_LEVEL_WARNING,  \
                                        format)
-#else   /* !__GNUC__ */
+#else   /* no varargs macros */
 static void
 g_error (const gchar *format,
          ...)
index aa10eaf..817957d 100644 (file)
@@ -97,7 +97,7 @@ GLogLevelFlags  g_log_set_always_fatal  (GLogLevelFlags  fatal_mask);
 #ifndef G_LOG_DOMAIN
 #define G_LOG_DOMAIN    ((gchar*) 0)
 #endif  /* G_LOG_DOMAIN */
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#ifdef G_HAVE_ISO_VARARGS
 #define g_error(...)    g_log (G_LOG_DOMAIN,         \
                                G_LOG_LEVEL_ERROR,    \
                                __VA_ARGS__)
@@ -110,7 +110,7 @@ GLogLevelFlags  g_log_set_always_fatal  (GLogLevelFlags  fatal_mask);
 #define g_warning(...)  g_log (G_LOG_DOMAIN,         \
                                G_LOG_LEVEL_WARNING,  \
                                __VA_ARGS__)
-#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)
+#elif defined(G_HAVE_GNUC_VARARGS)
 #define g_error(format...)      g_log (G_LOG_DOMAIN,         \
                                        G_LOG_LEVEL_ERROR,    \
                                        format)
@@ -123,7 +123,7 @@ GLogLevelFlags  g_log_set_always_fatal  (GLogLevelFlags  fatal_mask);
 #define g_warning(format...)    g_log (G_LOG_DOMAIN,         \
                                        G_LOG_LEVEL_WARNING,  \
                                        format)
-#else   /* !__GNUC__ */
+#else   /* no varargs macros */
 static void
 g_error (const gchar *format,
          ...)