Merge branch 'ebassi/c99-macro-varargs' into 'main'

Require C99's __VA_ARGS__

Closes #2681

See merge request GNOME/glib!2791
This commit is contained in:
Emmanuele Bassi 2022-06-30 01:40:55 +00:00
commit 5cf742d42e
3 changed files with 8 additions and 15 deletions

View File

@ -40,12 +40,12 @@ features are assumed. Those are detailed below.
GLib additionally requires Python 3 to build. GLib additionally requires Python 3 to build.
Varargs macros C99 Varargs macros
--- ---
_Not a hard requirement._ _Hard requirement._
GLib can work with either C99 or GNU style varargs macros. GLib requires C99 ``__VA_ARG__`` support for both C and C++ compilers.
Symbol visibility control Symbol visibility control
--- ---

View File

@ -118,8 +118,7 @@ typedef unsigned @glib_intptr_type_define@ guintptr;
@glib_vacopy@ @glib_vacopy@
@g_have_iso_c_varargs@ #define G_HAVE_ISO_VARARGS 1
@g_have_iso_cxx_varargs@
/* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi /* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
* is passed ISO vararg support is turned off, and there is no work * is passed ISO vararg support is turned off, and there is no work

View File

@ -1715,11 +1715,8 @@ g_have_iso_c_varargs = cc.compiles('''
call_a(2,3); call_a(2,3);
}''', name : 'ISO C99 varargs macros in C') }''', name : 'ISO C99 varargs macros in C')
if g_have_iso_c_varargs if not g_have_iso_c_varargs
glibconfig_conf.set('g_have_iso_c_varargs', ''' error('GLib requires a C compiler with support for C99 __VA_ARG__ in macros.')
#ifndef __cplusplus
# define G_HAVE_ISO_VARARGS 1
#endif''')
endif endif
g_have_iso_cxx_varargs = cxx.compiles(''' g_have_iso_cxx_varargs = cxx.compiles('''
@ -1729,11 +1726,8 @@ g_have_iso_cxx_varargs = cxx.compiles('''
call_a(2,3); call_a(2,3);
}''', name : 'ISO C99 varargs macros in C++') }''', name : 'ISO C99 varargs macros in C++')
if g_have_iso_cxx_varargs if not g_have_iso_cxx_varargs
glibconfig_conf.set('g_have_iso_cxx_varargs', ''' error('GLib requires a C++ compiler with support for C99 __VA_ARG__ in macros.')
#ifdef __cplusplus
# define G_HAVE_ISO_VARARGS 1
#endif''')
endif endif
g_have_gnuc_varargs = cc.compiles(''' g_have_gnuc_varargs = cc.compiles('''