mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-07-24 10:25:42 -04:00
Variadic macros are really useful, even if we can only use them conditionally. Unfortunately this means removing -Wc90-c99-compat, because apparently -Wno-variadic-macros is broken in gcc 13.2. Fortunately it is 2023... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
21 lines
751 B
Plaintext
21 lines
751 B
Plaintext
dnl --------------------------------------------------------------------------
|
|
dnl PA_VARIADIC_MACROS
|
|
dnl
|
|
dnl Check to see if the compiler supports C99 variadic macros.
|
|
dnl --------------------------------------------------------------------------
|
|
AC_DEFUN([PA_VARIADIC_MACROS],
|
|
[AC_CACHE_CHECK([if $CC supports variadic macros], [pa_cv_variadic_macros],
|
|
[AC_LINK_IFELSE([AC_LANG_SOURCE([
|
|
AC_INCLUDES_DEFAULT
|
|
#define myprintf(f, ...) printf(f, __VA_ARGS__)
|
|
int main(void)
|
|
{
|
|
myprintf("%s", "Hello, World!\n");
|
|
return 0;
|
|
}
|
|
])],[pa_cv_variadic_macros=yes],[pa_cv_variadic_macros=no])])
|
|
AS_IF([test "x$pa_cv_variadic_macros" = xyes],
|
|
[AC_DEFINE([HAVE_VARIADIC_MACROS], 1,
|
|
[define to 1 if your compiler supports C99 __VA_ARGS__ variadic macros.])])
|
|
])
|