#ifndef _WX_WXCHAR_H_
#define _WX_WXCHAR_H_
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "wxchar.h"
#endif
// ----------------------------------------------------------------------------
#ifdef wxHAVE_TCHAR_SUPPORT
+ #include <ctype.h>
+
// ctype.h functions
#define wxIsalnum _istalnum
#define wxIsalpha _istalpha
#define wxVsscanf _vstscanf
#define wxVsprintf _vstprintf
+ // special case: not all TCHAR-aware compilers have those
+ #if defined(__VISUALC__) || \
+ (defined(__BORLANDC__) && __BORLANDC__ >= 0x540)
+ #define wxVsnprintf_ _vsntprintf
+ #define wxSnprintf_ _sntprintf
+ #endif
+
// special case: these functions are missing under Win9x with Unicows so we
// have to implement them ourselves
#if wxUSE_UNICODE_MSLU
#define wxPuts putws
#define wxFputs fputws
#else
+ #define wxNEED_FPUTWC
+
#include <stdio.h>
int wxFputs(const wxChar *ch, FILE *stream);
We define function with a trailing underscore here because the real one is a
wrapper around it as explained below
*/
-#ifdef wxHAVE_TCHAR_SUPPORT
- #define wxVsnprintf_ _vsntprintf
- #define wxSnprintf_ _sntprintf
-#else // !TCHAR
+#ifndef wxVsnprintf_
#if wxUSE_UNICODE
#if defined(HAVE_VSWPRINTF)
#define wxVsnprintf_ vswprintf
#endif
#else // ASCII
- #if (defined(HAVE_VSNPRINTF) || defined(__WXMAC__))
+ // all versions of CodeWarrior supported by wxWindows apparently have
+ // vsnprintf()
+ #if defined(HAVE_VSNPRINTF) || defined(__MWERKS__)
// assume we have snprintf() too if we have vsnprintf()
#define wxVsnprintf_ vsnprintf
#define wxSnprintf_ snprintf
#endif
#endif
-#endif // TCHAR/!TCHAR
+#endif // wxVsnprintf_ not defined yet
#ifndef wxVsnprintf_
// no [v]snprintf(), cook our own
int wxVfprintf( FILE *stream, const wxChar *format, va_list ap );
int wxVprintf( const wxChar *format, va_list ap );
int wxVsprintf( wxChar *str, const wxChar *format, va_list ap );
-
- // 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
- int wxSnprintf( wxChar *str, size_t size, const wxChar *format, ... ) ATTRIBUTE_PRINTF_4;
- int wxVsnprintf( wxChar *str, size_t size, const wxChar *format, va_list ap );
- #else
- #define wxSnprintf wxSnprintf_
- #define wxVsnprintf wxVsnprintf_
- #endif
#endif // wxNEED_PRINTF_CONVERSION
+// 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
+ int wxSnprintf( wxChar *str, size_t size, const wxChar *format, ... ) ATTRIBUTE_PRINTF_4;
+ int wxVsnprintf( wxChar *str, size_t size, const wxChar *format, va_list ap );
+#else
+ #define wxSnprintf wxSnprintf_
+ #define wxVsnprintf wxVsnprintf_
+#endif
+
// ----------------------------------------------------------------------------
// various functions which might not be available in libc and for which we
// provide our own replacements in wxchar.cpp