maint: update copyright
[gnulib.git] / m4 / va-args.m4
1 # va-args.m4 serial 1
2 dnl Copyright (C) 2009-2014 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.
6
7 dnl Test for variadic macro support.
8 dnl Define HAVE_VA_ARGS if macros can use __VA_ARGS__.
9 AC_DEFUN([gl_VA_ARGS],
10 [
11   AC_CACHE_CHECK([whether the preprocessor allows variadic macros],
12     [gl_cv_c_va_args],
13     [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
14        #include <stdio.h>
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])
19     ])
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
23        __VA_ARGS__.])
24   fi
25 ])