+
+ if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
+
+ dnl check if snprintf() has support for positional arguments
+ dnl NB: if snprintf() has positional support we can safely suppose that also
+ dnl other *printf() functions support them as they all belong to the same
+ dnl family and they all fallback to the same implementation
+ AC_CACHE_CHECK([if snprintf supports positional arguments], wx_cv_func_snprintf_pos_params,
+ [
+ AC_TRY_RUN(
+ [
+ #include <stdio.h>
+
+ int main (void)
+ {
+ char buffer[128];
+ snprintf (buffer, 128, "%2\$d %3\$d %1\$d", 1, 2, 3);
+ if (strcmp ("2 3 1", buffer) == 0)
+ exit (0);
+ exit (1);
+ }
+ ],
+ wx_cv_func_snprintf_pos_params=no,
+ wx_cv_func_snprintf_pos_params=yes
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_snprintf_pos_params" = "yes"; then
+ AC_DEFINE(HAVE_UNIX98_PRINTF)
+ fi
+ fi