1 ?RCS: Copyright (c) 2006-2007, H.Merijn Brand
3 ?RCS: You may redistribute only under the terms of the Artistic License,
4 ?RCS: as specified in the README file that comes with the distribution.
5 ?RCS: You may reuse parts of this distribution only within the terms of
6 ?RCS: that same Artistic License; a copy of which may be found at the root
7 ?RCS: of the source tree for dist 3.0.
9 ?MAKE:d_c99_variadic_macros: Compile Setvar cat rm_try run
10 ?MAKE: -pick add $@ %<
11 ?S:d_c99_variadic_macros:
12 ?S: This variable conditionally defines the HAS_C99_VARIADIC_MACROS
13 ?S: symbol, which indicates to the C program that C99 variadic macros
16 ?C:HAS_C99_VARIADIC_MACROS:
17 ?C: If defined, the compiler supports C99 variadic macros.
19 ?H:#$d_c99_variadic_macros HAS_C99_VARIADIC_MACROS /**/
22 : see if the Compiler supports C99 variadic macros
23 echo "Checking for C99 variadic macros." >&4
28 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
32 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
38 if eval $compile && $run ./try 2>&1 >/dev/null; then
39 case "`$run ./try`" in
41 echo "You have C99 variadic macros." >&4
42 d_c99_variadic_macros="$define"
45 echo "You don't have functional C99 variadic macros." >&4
46 d_c99_variadic_macros="$undef"
50 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
51 d_c99_variadic_macros="$undef"