X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d8339072302116b4b5b489c0304bb313001144a5..b8e7b6738fe00529fdeae26e6cfea1ccc2a00a76:/include/wx/wxchar.h diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index 5ca84cdbe1..68cd97448f 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -2,7 +2,7 @@ * Name: wx/wxchar.h * Purpose: Declarations common to wx char/wchar_t usage (wide chars) * Author: Joel Farley, Ove Kåven - * Modified by: Vadim Zeitlin, Robert Roebling + * Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee * Created: 1998/06/12 * RCS-ID: $Id$ * Copyright: (c) 1998-2002 wxWindows dev team @@ -22,10 +22,7 @@ /* check whether we have wchar_t and which size it is if we do */ #if !defined(wxUSE_WCHAR_T) - #if defined(__WIN16__) - /* no wchar_t under Win16 regadrless of compiler used */ - #define wxUSE_WCHAR_T 0 - #elif defined(__UNIX__) + #if defined(__UNIX__) #if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) || defined(__DARWIN__) #define wxUSE_WCHAR_T 1 #else @@ -76,6 +73,11 @@ #define HAVE_WCHAR_H #endif #endif +#if defined(__MWERKS__) && !defined(__MACH__) + #ifndef HAVE_WCSLEN + #define HAVE_WCSLEN + #endif +#endif #if wxUSE_WCHAR_T #ifdef HAVE_WCHAR_H @@ -303,13 +305,11 @@ #define wxPuts _putts #define wxScanf _tscanf #if defined(__DMC__) - /* Digital Mars adds count to _stprintf (C99) so it does not fit wxWindows needs */ - /* and there is a bug in D Mars tchar.h prior to 8.39.4n, so define as sprintf */ - /* for non-unicode builds CE */ - /* Unicode broken 10 Feb 04 Fixme */ #if wxUSE_UNICODE - #define wxSprintf swprintf + /* Digital Mars adds count to _stprintf (C99) so prototype conversion see wxchar.cpp */ + int wxSprintf (wchar_t * __RESTRICT s, const wchar_t * __RESTRICT format, ... ) ; #else + /* and there is a bug in D Mars tchar.h prior to 8.39.4n, so define as sprintf */ #define wxSprintf sprintf #endif #else @@ -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 @@ -920,6 +919,12 @@ WXDLLIMPEXP_BASE int wxSystem(const wxChar *psz); const wxChar *fmt, const struct tm *tm); #endif /* wxNEED_WX_TIME_H */ +#ifndef wxCtime +#include +WXDLLIMPEXP_BASE wxChar *wxCtime(const time_t *timep); +#endif + + /* missing functions in some WinCE versions */ #ifdef _WIN32_WCE #if (_WIN32_WCE < 300)