Use compile checks for ISO C99 and GNU extension varargs macros syntax and

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.
This commit is contained in:
Owen Taylor 2001-05-18 16:00:54 +00:00 committed by Owen Taylor
parent 05f143a808
commit 5df92b7423
11 changed files with 104 additions and 14 deletions

View 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> 2001-05-18 Michael Natterer <mitch@convergence.de>
* gmarkup.c: don't g_strdup()/g_free() all parsed attributes and * 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> 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. to be as robust as possible in out-of-memory.
* gmessages.c (g_log_default_handler): Remove some dead * gmessages.c (g_log_default_handler): Remove some dead

View 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> 2001-05-18 Michael Natterer <mitch@convergence.de>
* gmarkup.c: don't g_strdup()/g_free() all parsed attributes and * 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> 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. to be as robust as possible in out-of-memory.
* gmessages.c (g_log_default_handler): Remove some dead * gmessages.c (g_log_default_handler): Remove some dead

View 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> 2001-05-18 Michael Natterer <mitch@convergence.de>
* gmarkup.c: don't g_strdup()/g_free() all parsed attributes and * 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> 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. to be as robust as possible in out-of-memory.
* gmessages.c (g_log_default_handler): Remove some dead * gmessages.c (g_log_default_handler): Remove some dead

View 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> 2001-05-18 Michael Natterer <mitch@convergence.de>
* gmarkup.c: don't g_strdup()/g_free() all parsed attributes and * 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> 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. to be as robust as possible in out-of-memory.
* gmessages.c (g_log_default_handler): Remove some dead * gmessages.c (g_log_default_handler): Remove some dead

View 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> 2001-05-18 Michael Natterer <mitch@convergence.de>
* gmarkup.c: don't g_strdup()/g_free() all parsed attributes and * 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> 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. to be as robust as possible in out-of-memory.
* gmessages.c (g_log_default_handler): Remove some dead * gmessages.c (g_log_default_handler): Remove some dead

View 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> 2001-05-18 Michael Natterer <mitch@convergence.de>
* gmarkup.c: don't g_strdup()/g_free() all parsed attributes and * 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> 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. to be as robust as possible in out-of-memory.
* gmessages.c (g_log_default_handler): Remove some dead * gmessages.c (g_log_default_handler): Remove some dead

View 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> 2001-05-18 Michael Natterer <mitch@convergence.de>
* gmarkup.c: don't g_strdup()/g_free() all parsed attributes and * 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> 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. to be as robust as possible in out-of-memory.
* gmessages.c (g_log_default_handler): Remove some dead * gmessages.c (g_log_default_handler): Remove some dead

View 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> 2001-05-18 Michael Natterer <mitch@convergence.de>
* gmarkup.c: don't g_strdup()/g_free() all parsed attributes and * 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> 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. to be as robust as possible in out-of-memory.
* gmessages.c (g_log_default_handler): Remove some dead * gmessages.c (g_log_default_handler): Remove some dead

View File

@ -376,6 +376,23 @@ case x$glib_cv_hasinline in
xyes) AC_DEFINE(G_HAVE_INLINE,1,[Have inline keyword]) xyes) AC_DEFINE(G_HAVE_INLINE,1,[Have inline keyword])
esac 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 # check for bytesex stuff
AC_C_BIGENDIAN AC_C_BIGENDIAN
@ -1627,6 +1644,20 @@ $glib_inline
#endif /* !__cplusplus */ #endif /* !__cplusplus */
_______EOF _______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 echo >>$outfile
if test x$g_have_eilseq = xno; then if test x$g_have_eilseq = xno; then
cat >>$outfile <<_______EOF cat >>$outfile <<_______EOF
@ -1907,6 +1938,9 @@ if test x$glib_cv_has__inline__ = xyes; then
#define G_HAVE___INLINE__ 1" #define G_HAVE___INLINE__ 1"
fi fi
g_have_gnuc_varargs=$g_have_gnuc_varargs
g_have_iso_varargs=$g_have_iso_varargs
case xyes in case xyes in
x$ac_cv_c_bigendian) x$ac_cv_c_bigendian)
g_byte_order=G_BIG_ENDIAN g_byte_order=G_BIG_ENDIAN

View File

@ -97,7 +97,7 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#ifndef G_LOG_DOMAIN #ifndef G_LOG_DOMAIN
#define G_LOG_DOMAIN ((gchar*) 0) #define G_LOG_DOMAIN ((gchar*) 0)
#endif /* G_LOG_DOMAIN */ #endif /* G_LOG_DOMAIN */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #ifdef G_HAVE_ISO_VARARGS
#define g_error(...) g_log (G_LOG_DOMAIN, \ #define g_error(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \ G_LOG_LEVEL_ERROR, \
__VA_ARGS__) __VA_ARGS__)
@ -110,7 +110,7 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#define g_warning(...) g_log (G_LOG_DOMAIN, \ #define g_warning(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_WARNING, \ G_LOG_LEVEL_WARNING, \
__VA_ARGS__) __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, \ #define g_error(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \ G_LOG_LEVEL_ERROR, \
format) format)
@ -123,7 +123,7 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#define g_warning(format...) g_log (G_LOG_DOMAIN, \ #define g_warning(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_WARNING, \ G_LOG_LEVEL_WARNING, \
format) format)
#else /* !__GNUC__ */ #else /* no varargs macros */
static void static void
g_error (const gchar *format, g_error (const gchar *format,
...) ...)

View File

@ -97,7 +97,7 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#ifndef G_LOG_DOMAIN #ifndef G_LOG_DOMAIN
#define G_LOG_DOMAIN ((gchar*) 0) #define G_LOG_DOMAIN ((gchar*) 0)
#endif /* G_LOG_DOMAIN */ #endif /* G_LOG_DOMAIN */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #ifdef G_HAVE_ISO_VARARGS
#define g_error(...) g_log (G_LOG_DOMAIN, \ #define g_error(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \ G_LOG_LEVEL_ERROR, \
__VA_ARGS__) __VA_ARGS__)
@ -110,7 +110,7 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#define g_warning(...) g_log (G_LOG_DOMAIN, \ #define g_warning(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_WARNING, \ G_LOG_LEVEL_WARNING, \
__VA_ARGS__) __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, \ #define g_error(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_ERROR, \ G_LOG_LEVEL_ERROR, \
format) format)
@ -123,7 +123,7 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
#define g_warning(format...) g_log (G_LOG_DOMAIN, \ #define g_warning(format...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_WARNING, \ G_LOG_LEVEL_WARNING, \
format) format)
#else /* !__GNUC__ */ #else /* no varargs macros */
static void static void
g_error (const gchar *format, g_error (const gchar *format,
...) ...)