X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5da414766e0bf268e37d566f5ea39dc47adce01c..855f31ebe72bef834a32df2c274b41fb282ad265:/include/wx/wxchar.h diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index 06e5bf61de..84e8ee28f2 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -18,6 +18,8 @@ #include "wx/platform.h" #include "wx/dlimpexp.h" +#include /* we use FILE below */ + #if defined(HAVE_STRTOK_R) && defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS char *strtok_r(char *, const char *, char **); #endif @@ -109,6 +111,10 @@ /* include stdlib.h for wchar_t */ #include #endif /* HAVE_WCHAR_H */ + + #ifdef HAVE_WIDEC_H + #include + #endif #endif /* wxUSE_WCHAR_T */ /* ---------------------------------------------------------------------------- */ @@ -322,6 +328,12 @@ #define wxStrtod _tcstod #define wxStrtol _tcstol #define wxStrtoul _tcstoul + #ifdef __VISUALC__ + #if __VISUALC__ >= 1300 && !defined(__WXWINCE__) + #define wxStrtoll _tcstoi64 + #define wxStrtoull _tcstoui64 + #endif /* VC++ 7+ */ + #endif #define wxStrxfrm _tcsxfrm /* stdio.h functions */ @@ -329,6 +341,8 @@ #define wxFgetchar _fgettchar #define wxFgets _fgetts #if wxUSE_UNICODE_MSLU + WXDLLIMPEXP_BASE FILE * wxMSLU__tfopen(const wxChar *name, const wxChar *mode); + #define wxFopen wxMSLU__tfopen #else #define wxFopen _tfopen @@ -371,6 +385,9 @@ /* special case: these functions are missing under Win9x with Unicows so we */ /* have to implement them ourselves */ #if wxUSE_UNICODE_MSLU + WXDLLIMPEXP_BASE int wxMSLU__trename(const wxChar *oldname, const wxChar *newname); + WXDLLIMPEXP_BASE int wxMSLU__tremove(const wxChar *name); + #define wxRemove wxMSLU__tremove #define wxRename wxMSLU__trename #else @@ -535,6 +552,11 @@ #define wxStrtod wcstod #define wxStrtol wcstol #define wxStrtoul wcstoul + #ifdef HAVE_WCSTOULL + /* assume that we have wcstoull(), which is also C99, too */ + #define wxStrtoll wcstoll + #define wxStrtoull wcstoull + #endif /* HAVE_WCSTOULL */ #define wxStrxfrm wcsxfrm #define wxFgetc fgetwc @@ -704,6 +726,11 @@ #endif #define wxStrtol strtol #define wxStrtoul strtoul + #ifdef HAVE_STRTOULL + /* assume that we have wcstoull(), which is also C99, too */ + #define wxStrtoll strtoll + #define wxStrtoull strtoull + #endif /* HAVE_WCSTOULL */ #define wxStrxfrm strxfrm /* stdio.h functions */ @@ -753,6 +780,10 @@ #endif /* Unicode/ASCII */ #endif /* TCHAR-aware compilers/the others */ +#ifdef wxStrtoll + #define wxHAS_STRTOLL +#endif + /* various special cases */ @@ -840,7 +871,7 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */ #else extern #endif - int snprintf(char *str, size_t size, const char *format, ...); + WXDLLIMPEXP_BASE int snprintf(char *str, size_t size, const char *format, ...); #endif /* !HAVE_SNPRINTF_DECL */ /* Wrapper for vsnprintf if it's 3rd parameter is non-const. Note: the @@ -856,10 +887,8 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */ /* MinGW MSVCRT has non-standard vswprintf() (for MSVC compatibility presumably) and normally _vsnwprintf() is used instead - - vswprintf() under (early versions of) OS X is buggy */ -#if defined(HAVE_VSWPRINTF) && (defined(__MINGW32__) || defined(__DARWIN__)) +#if defined(HAVE_VSWPRINTF) && defined(__MINGW32__) #undef HAVE_VSWPRINTF #endif @@ -886,9 +915,11 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */ #else /* !HAVE_UNIX98_PRINTF */ /* The only compiler with positional parameters support under Windows - is VC++ 8.0 which provides a new xxprintf_p() functions family + is VC++ 8.0 which provides a new xxprintf_p() functions family. + The 2003 PSDK includes a slightly earlier version of VC8 than the + main release and does not have the printf_p functions. */ - #if defined(__VISUALC__) && __VISUALC__ >= 1400 + #if defined _MSC_FULL_VER && _MSC_FULL_VER >= 140050727 && !defined __WXWINCE__ #if wxUSE_UNICODE #define wxVsnprintf_ _vswprintf_p #else @@ -951,13 +982,18 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */ #endif /* wxUSE_PRINTF_POS_PARAMS/!wxUSE_PRINTF_POS_PARAMS */ #ifndef wxSnprintf_ - /* no [v]snprintf(), cook our own */ + /* no snprintf(), cook our own */ WXDLLIMPEXP_BASE int wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...) ATTRIBUTE_PRINTF_3; #endif #ifndef wxVsnprintf_ + /* no (suitable) vsnprintf(), cook our own */ WXDLLIMPEXP_BASE int wxVsnprintf_(wxChar *buf, size_t len, const wxChar *format, va_list argptr); + + #define wxUSE_WXVSNPRINTF 1 +#else + #define wxUSE_WXVSNPRINTF 0 #endif /* @@ -988,9 +1024,6 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */ either because we don't have them at all or because they don't have the semantics we need */ - - #include /* for FILE */ - int wxScanf( const wxChar *format, ... ) ATTRIBUTE_PRINTF_1; int wxSscanf( const wxChar *str, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2; int wxFscanf( FILE *stream, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2;