1 dnl @synopsis AC_FUNC_VSNPRINTF_C99
3 dnl Check whether there is a vsnprintf() function with C99 semantics installed.
5 AC_DEFUN([AC_FUNC_VSNPRINTF_C99],
6 [AC_CACHE_CHECK(for C99 vsnprintf,
7 ac_cv_func_vsnprintf_c99,
20 r = vsnprintf(buffer, 5, s, args);
34 }], ac_cv_func_vsnprintf_c99=yes, ac_cv_func_vsnprintf_c99=no, ac_cv_func_vsnprintf_c99=no)])
35 dnl Note that the default is to be pessimistic in the case of cross compilation.
36 dnl If you know that the target has a C99 vsnprintf(), you can get around this
37 dnl by setting ac_func_vsnprintf_c99 to yes, as described in the Autoconf manual.
38 if test $ac_cv_func_vsnprintf_c99 = yes; then
39 AC_DEFINE(HAVE_C99_VSNPRINTF, 1,
40 [Define if you have a version of the vsnprintf function
41 with semantics as specified by the ISO C99 standard.])
43 ])# AC_FUNC_VSNPRINTF_C99
46 dnl @synopsis AC_FUNC_PRINTF_UNIX98
48 dnl Check whether the printf() family supports Unix98 %n$ positional parameters
50 AC_DEFUN([AC_FUNC_PRINTF_UNIX98],
51 [AC_CACHE_CHECK(whether printf supports positional parameters,
52 ac_cv_func_printf_unix98,
61 sprintf (buffer, "%2\$d %3\$d %1\$d", 1, 2, 3);
62 if (strcmp ("2 3 1", buffer) == 0)
65 }], ac_cv_func_printf_unix98=yes, ac_cv_func_printf_unix98=no, ac_cv_func_printf_unix98=no)])
66 dnl Note that the default is to be pessimistic in the case of cross compilation.
67 dnl If you know that the target printf() supports positional parameters, you can get around
68 dnl this by setting ac_func_printf_unix98 to yes, as described in the Autoconf manual.
69 if test $ac_cv_func_printf_unix98 = yes; then
70 AC_DEFINE(HAVE_UNIX98_PRINTF, 1,
71 [Define if your printf function family supports positional parameters
72 as specified by Unix98.])
74 ])# AC_FUNC_PRINTF_UNIX98