1 dnl ######################################################################
2 dnl check if compiler can handle variable-length argument macros
3 AC_DEFUN([AMU_VARARGS_MACROS],
5 AC_CACHE_CHECK(if compiler can handle variable-length macros,
11 #define foo(str,size,fmt,...) bar(__FILE__,__LINE__,(str),(size),(fmt),__VA_ARGS__)
15 foo(a, sizeof(a), "%d,%d", 1, 2);
16 ], ac_cv_varargs_macros=c99,
20 #define foo(str,size,args...) bar(__FILE__,__LINE__,(str),(size),(fmt),args)
24 foo(a, sizeof(a), "%d,%d", 1, 2);
25 ], ac_cv_varargs_macros=gcc, ac_cv_varargs_macros=none))
27 if test "$ac_cv_varargs_macros" = c99
29 AC_DEFINE(HAVE_C99_VARARGS_MACROS, 1,
30 [System supports C99-style variable-length argument macros])
32 if test "$ac_cv_varargs_macros" = gcc
34 AC_DEFINE(HAVE_GCC_VARARGS_MACROS, 1,
35 [System supports GCC-style variable-length argument macros])
39 dnl ======================================================================