2 dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl Test for variadic macro support.
8 dnl Define HAVE_VA_ARGS if macros can use __VA_ARGS__.
11 AC_CACHE_CHECK([whether the preprocessor allows variadic macros],
13 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
15 #define a(func, arg, ...) func (arg, __VA_ARGS__)
16 #define b(...) a (__VA_ARGS__)
17 ]], [[b (printf, "%s", "test");]])],
18 [gl_cv_c_va_args=yes], [gl_cv_c_va_args=no])
20 if test $gl_cv_c_va_args = yes; then
21 AC_DEFINE([HAVE_VA_ARGS], [1],
22 [Define to 1 if the preprocessor supports variadic macros and