From 46d492a879f7fec474c0847dd0637593453746eb Mon Sep 17 00:00:00 2001 From: David Elliott Date: Tue, 30 Mar 2004 01:50:58 +0000 Subject: [PATCH] Do not #undef wxNEED_PRINTF_CONVERSION if wxVsnprintf_ has not been defined (to an OS implementation). Instead, check when delcaring the wxSnprintf and wxVsnprintf wrappers and only define them if wxVsnprintf_ has been defined. This allows HAVE_VSWPRINTF to be false yet still allow other OS wchar functions to be used which will be needed to work around FreeBSD/Darwin. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/wxchar.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index f0eea9f373..68cd97448f 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -750,12 +750,7 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */ We choose to always emulate Windows behaviour as more useful for us so even if we have wprintf() we still must wrap it in a non trivial wxPrintf(). - However, if we don't have any vswprintf() at all we don't need to redefine - anything as our own wxVsnprintf_() already behaves as needed. */ -#ifndef wxVsnprintf_ - #undef wxNEED_PRINTF_CONVERSION -#endif #if defined(wxNEED_PRINTF_CONVERSION) || defined(wxNEED_WPRINTF) /* @@ -780,7 +775,11 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */ /* these 2 can be simply mapped to the versions with underscore at the end */ /* if we don't have to do the conversion */ -#ifdef wxNEED_PRINTF_CONVERSION +/* + However, if we don't have any vswprintf() at all we don't need to redefine + anything as our own wxVsnprintf_() already behaves as needed. +*/ +#if defined(wxNEED_PRINTF_CONVERSION) && defined(wxVsnprintf_) int wxSnprintf( wxChar *str, size_t size, const wxChar *format, ... ) ATTRIBUTE_PRINTF_3; int wxVsnprintf( wxChar *str, size_t size, const wxChar *format, va_list ap ); #else -- 2.45.2