added wxUSE_PRINTF_POS_PARAMS which can be used to force the use of built-in printf (2nd part of patch 1462778)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
42
configure.in
42
configure.in
@@ -424,6 +424,7 @@ if test $DEBUG_CONFIGURE = 1; then
|
||||
DEFAULT_wxUSE_SOUND=no
|
||||
DEFAULT_wxUSE_MEDIACTRL=no
|
||||
DEFAULT_wxUSE_GSTREAMER8=no
|
||||
DEFAULT_wxUSE_PRINTF_POS_PARAM=no
|
||||
DEFAULT_wxUSE_INTL=no
|
||||
DEFAULT_wxUSE_CONFIG=no
|
||||
DEFAULT_wxUSE_FONTMAP=no
|
||||
@@ -636,6 +637,7 @@ else
|
||||
DEFAULT_wxUSE_SOUND=yes
|
||||
DEFAULT_wxUSE_MEDIACTRL=no
|
||||
DEFAULT_wxUSE_GSTREAMER8=no
|
||||
DEFAULT_wxUSE_PRINTF_POS_PARAM=yes
|
||||
DEFAULT_wxUSE_INTL=yes
|
||||
DEFAULT_wxUSE_CONFIG=yes
|
||||
DEFAULT_wxUSE_FONTMAP=yes
|
||||
@@ -957,7 +959,7 @@ WX_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Un
|
||||
WX_ARG_ENABLE(sound, [ --enable-sound use wxSound class], wxUSE_SOUND)
|
||||
WX_ARG_ENABLE(mediactrl, [ --enable-mediactrl use wxMediaCtrl class], wxUSE_MEDIACTRL)
|
||||
WX_ARG_ENABLE(gstreamer8, [ --enable-gstreamer8 force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix], wxUSE_GSTREAMER8)
|
||||
WX_ARG_ENABLE(wxprintfv, [ --enable-wxprintfv use wxWidgets implementation of vprintf()], wxUSE_EXPERIMENTAL_PRINTF)
|
||||
WX_ARG_ENABLE(printfposparam,[ --enable-printfposparam use wxVsnprintf() which supports positional parameters], wxUSE_PRINTF_POS_PARAMS)
|
||||
WX_ARG_ENABLE(zipstream, [ --enable-zipstream use wxZip streams], wxUSE_ZIPSTREAM)
|
||||
|
||||
WX_ARG_ENABLE(url, [ --enable-url use wxURL class], wxUSE_URL)
|
||||
@@ -4320,8 +4322,41 @@ if test "$ac_cv_func_snprintf" = "yes"; then
|
||||
AC_DEFINE(HAVE_BROKEN_SNPRINTF_DECL)
|
||||
fi
|
||||
fi
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
|
||||
if test "$wxUSE_UNICODE" = yes; then
|
||||
dnl also look if we have wide char IO functions
|
||||
AC_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf)
|
||||
@@ -5648,6 +5683,11 @@ if test "$wxUSE_STREAMS" = "yes" ; then
|
||||
AC_DEFINE(wxUSE_STREAMS)
|
||||
fi
|
||||
|
||||
if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
|
||||
AC_DEFINE(wxUSE_PRINTF_POS_PARAMS)
|
||||
fi
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl time/date functions
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user