Require C99's __VA_ARGS__

We have fallback in places for GNU's variadic arguments in macros, and
for static inline functions with variadic arguments as an fallback of
last resort, but going forward we are going to depend on `__VA_ARGS__`
for macros that cannot be re-implemented using a static inline function.

Fixes: #2681
This commit is contained in:
Emmanuele Bassi
2022-06-29 18:12:55 +01:00
parent 89b34963e7
commit 2a12de5b1d
3 changed files with 8 additions and 15 deletions

View File

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