3 * Purpose: Declarations common to wx char/wchar_t usage (wide chars)
4 * Author: Joel Farley, Ove Kåven
5 * Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee
8 * Copyright: (c) 1998-2006 wxWidgets dev team
9 * Licence: wxWindows licence
12 /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
17 /* defs.h indirectly includes this file, so don't include it here */
18 #include "wx/platform.h"
19 #include "wx/dlimpexp.h"
21 #include <stdio.h> /* we use FILE below */
23 #if defined(HAVE_STRTOK_R) && defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
24 char *strtok_r(char *, const char *, char **);
27 /* check whether we have wchar_t and which size it is if we do */
28 #if !defined(wxUSE_WCHAR_T)
30 #if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) || defined(__DARWIN__)
31 #define wxUSE_WCHAR_T 1
33 #define wxUSE_WCHAR_T 0
35 #elif defined(__GNUWIN32__) && !defined(__MINGW32__)
36 #define wxUSE_WCHAR_T 0
37 #elif defined(__WATCOMC__)
38 #define wxUSE_WCHAR_T 0
39 #elif defined(__VISAGECPP__) && (__IBMCPP__ < 400)
40 #define wxUSE_WCHAR_T 0
42 /* add additional compiler checks if this fails */
43 #define wxUSE_WCHAR_T 1
45 #endif /* !defined(wxUSE_WCHAR_T) */
47 /* Unicode support requires wchar_t */
48 #if wxUSE_UNICODE && !wxUSE_WCHAR_T
49 #error "wchar_t must be available in Unicode build"
53 Standard headers we need here.
55 NB: don't include any wxWidgets headers here because almost all of them include
59 /* Required for wxPrintf() etc */
62 /* Almost all compiler have strdup(), but not quite all: CodeWarrior under Mac */
63 /* and VC++ for Windows CE don't provide it */
64 #if defined(__VISUALC__) && __VISUALC__ >= 1400
65 #define wxStrdupA _strdup
66 #elif !(defined(__MWERKS__) && defined(__WXMAC__)) && !defined(__WXWINCE__)
67 /* use #define, not inline wrapper, as it is tested with #ifndef below */
68 #define wxStrdupA strdup
72 non Unix compilers which do have wchar.h (but not tchar.h which is included
73 below and which includes wchar.h anyhow).
75 Actually MinGW has tchar.h, but it does not include wchar.h
77 #if defined(__MWERKS__) || defined(__VISAGECPP__) || defined(__MINGW32__) || defined(__WATCOMC__)
82 #if defined(__MWERKS__) && !defined(__MACH__)
90 /* the current (as of Nov 2002) version of cygwin has a bug in its */
91 /* wchar.h -- there is no extern "C" around the declarations in it and */
92 /* this results in linking errors later; also, at least on some */
93 /* Cygwin versions, wchar.h requires sys/types.h */
95 #include <sys/types.h>
103 #if defined(__CYGWIN__) && defined(__cplusplus)
105 #endif /* Cygwin and C++ */
107 #elif defined(HAVE_WCSTR_H)
108 /* old compilers have relevant declarations here */
110 #elif defined(__FreeBSD__) || defined(__DARWIN__) || defined(__EMX__)
111 /* include stdlib.h for wchar_t */
113 #endif /* HAVE_WCHAR_H */
118 #endif /* wxUSE_WCHAR_T */
120 /* ---------------------------------------------------------------------------- */
121 /* define wxHAVE_TCHAR_SUPPORT for the compilers which support the TCHAR type */
122 /* mapped to either char or wchar_t depending on the ASCII/Unicode mode and have */
123 /* the function mapping _tfoo() -> foo() or wfoo() */
124 /* ---------------------------------------------------------------------------- */
126 /* VC++ and BC++ starting with 5.2 have TCHAR support */
128 #define wxHAVE_TCHAR_SUPPORT
129 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)
130 #define wxHAVE_TCHAR_SUPPORT
132 #elif defined(__WATCOMC__)
133 #define wxHAVE_TCHAR_SUPPORT
134 #elif defined(__DMC__)
135 #define wxHAVE_TCHAR_SUPPORT
136 #elif defined(__WXPALMOS__)
138 #elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 )
139 #define wxHAVE_TCHAR_SUPPORT
143 #elif 0 && defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
144 /* VZ: the old VisualAge definitions were completely wrong and had no */
145 /* chance at all to work in Unicode build anyhow so let's pretend that */
146 /* VisualAge does _not_ support TCHAR for the moment (as indicated by */
147 /* "0 &&" above) until someone really has time to delve into Unicode */
148 /* issues under OS/2 */
150 /* VisualAge 4.0+ supports TCHAR */
151 #define wxHAVE_TCHAR_SUPPORT
152 #endif /* compilers with (good) TCHAR support */
154 #if defined(__MWERKS__)
155 /* Metrowerks only has wide char support for OS X >= 10.3 */
156 #if !defined(__DARWIN__) || \
157 (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
158 #define wxHAVE_MWERKS_UNICODE
161 #ifdef wxHAVE_MWERKS_UNICODE
162 #define HAVE_WPRINTF 1
163 #define HAVE_WCSRTOMBS 1
164 #define HAVE_VSWPRINTF 1
166 #endif /* __MWERKS__ */
168 #ifdef wxHAVE_TCHAR_SUPPORT
169 /* get TCHAR definition if we've got it */
172 /* we surely do have wchar_t if we have TCHAR */
173 #ifndef wxUSE_WCHAR_T
174 #define wxUSE_WCHAR_T 1
175 #endif /* !defined(wxUSE_WCHAR_T) */
177 /* and we also do have wcslen() */
181 #endif /* wxHAVE_TCHAR_SUPPORT */
183 /* ---------------------------------------------------------------------------- */
184 /* define wxChar type */
185 /* ---------------------------------------------------------------------------- */
187 /* TODO: define wxCharInt to be equal to either int or wint_t? */
191 typedef signed char wxSChar
;
192 typedef unsigned char wxUChar
;
194 /* VZ: note that VC++ defines _T[SU]CHAR simply as wchar_t and not as */
195 /* signed/unsigned version of it which (a) makes sense to me (unlike */
196 /* char wchar_t is always unsigned) and (b) was how the previous */
197 /* definitions worked so keep it like this */
199 /* Sun's SunPro compiler supports the wchar_t type and wide character */
200 /* functions, but does not define __WCHAR_TYPE__. Define it here to */
201 /* allow unicode enabled builds. */
202 #if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
203 #define __WCHAR_TYPE__ wxchar_t
206 /* GNU libc has __WCHAR_TYPE__ which requires special treatment, see */
208 #if !defined(__WCHAR_TYPE__) || \
209 (!defined(__GNUC__) || wxCHECK_GCC_VERSION(2, 96))
211 typedef wchar_t wxChar
;
212 typedef wchar_t wxSChar
;
213 typedef wchar_t wxUChar
;
214 #else /* __WCHAR_TYPE__ and gcc < 2.96 */
215 /* VS: wxWidgets used to define wxChar as __WCHAR_TYPE__ here. However, */
216 /* this doesn't work with new GCC 3.x compilers because wchar_t is */
217 /* C++'s builtin type in the new standard. OTOH, old compilers (GCC */
218 /* 2.x) won't accept new definition of wx{S,U}Char, therefore we */
219 /* have to define wxChar conditionally depending on detected */
220 /* compiler & compiler version. */
221 /* with old definition of wxChar. */
222 typedef __WCHAR_TYPE__ wxChar
;
223 typedef __WCHAR_TYPE__ wxSChar
;
224 typedef __WCHAR_TYPE__ wxUChar
;
225 #endif /* __WCHAR_TYPE__ */
226 #endif /* ASCII/Unicode */
228 /* ---------------------------------------------------------------------------- */
229 /* define _T() and related macros */
230 /* ---------------------------------------------------------------------------- */
232 /* BSD systems define _T() to be something different in ctype.h, override it */
233 #if defined(__FreeBSD__) || defined(__DARWIN__)
238 /* could already be defined by tchar.h (it's quasi standard) */
243 /* use wxCONCAT_HELPER so that x could be expanded if it's a macro */
244 #define _T(x) wxCONCAT_HELPER(L, x)
245 #endif /* ASCII/Unicode */
246 #endif /* !defined(_T) */
248 /* although global macros with such names are normally bad, we want to have */
249 /* another name for _T() which should be used to avoid confusion between _T() */
250 /* and _() in wxWidgets sources */
253 /* a helper macro allowing to make another macro Unicode-friendly, see below */
254 #define wxAPPLY_T(x) _T(x)
256 /* Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs */
258 #define __TFILE__ wxAPPLY_T(__FILE__)
262 #define __TDATE__ wxAPPLY_T(__DATE__)
266 #define __TTIME__ wxAPPLY_T(__TIME__)
270 define wxFoo() function for each standard foo() function whose signature
271 (exceptionally including the return type) includes any mention of char:
272 wxFoo() is going to be a Unicode-friendly version of foo(), i.e. will have
273 the same signature but with char replaced by wxChar which allows us to use
274 it in Unicode build as well
277 #ifdef wxHAVE_TCHAR_SUPPORT
280 #if defined(__WATCOMC__) && defined(UNICODE)
281 #define WXWCHAR_T_CAST(c) (wint_t)(c)
283 #define WXWCHAR_T_CAST(c) c
286 /* ctype.h functions */
287 #define wxIsalnum(c) _istalnum(WXWCHAR_T_CAST(c))
288 #define wxIsalpha(c) _istalpha(WXWCHAR_T_CAST(c))
289 #define wxIscntrl(c) _istcntrl(WXWCHAR_T_CAST(c))
290 #define wxIsdigit(c) _istdigit(WXWCHAR_T_CAST(c))
291 #define wxIsgraph(c) _istgraph(WXWCHAR_T_CAST(c))
292 #define wxIslower(c) _istlower(WXWCHAR_T_CAST(c))
293 #define wxIsprint(c) _istprint(WXWCHAR_T_CAST(c))
294 #define wxIspunct(c) _istpunct(WXWCHAR_T_CAST(c))
295 #define wxIsspace(c) _istspace(WXWCHAR_T_CAST(c))
296 #define wxIsupper(c) _istupper(WXWCHAR_T_CAST(c))
297 #define wxIsxdigit(c) _istxdigit(WXWCHAR_T_CAST(c))
300 There is a bug in VC6 C RTL: toxxx() functions dosn't do anything with
301 signed chars < 0, so "fix" it here.
303 #define wxTolower(c) _totlower((wxUChar)(c))
304 #define wxToupper(c) _totupper((wxUChar)(c))
306 /* locale.h functons */
307 #define wxSetlocale _tsetlocale
309 /* string.h functions */
310 #define wxStrcat _tcscat
311 #define wxStrchr _tcschr
312 #define wxStrcmp _tcscmp
313 #define wxStrcoll _tcscoll
314 #define wxStrcpy _tcscpy
315 #define wxStrcspn _tcscspn
316 #define wxStrdupW _wcsdup /* notice the 'W'! */
317 #define wxStrftime _tcsftime
318 #define wxStricmp _tcsicmp
319 #define wxStrnicmp _tcsnicmp
320 #define wxStrlen_ _tcslen /* used in wxStrlen inline function */
321 #define wxStrncat _tcsncat
322 #define wxStrncmp _tcsncmp
323 #define wxStrncpy _tcsncpy
324 #define wxStrpbrk _tcspbrk
325 #define wxStrrchr _tcsrchr
326 #define wxStrspn _tcsspn
327 #define wxStrstr _tcsstr
328 #define wxStrtod _tcstod
329 #define wxStrtol _tcstol
330 #define wxStrtoul _tcstoul
332 #if __VISUALC__ >= 1300 && !defined(__WXWINCE__)
333 #define wxStrtoll _tcstoi64
334 #define wxStrtoull _tcstoui64
337 #define wxStrxfrm _tcsxfrm
339 /* stdio.h functions */
340 #define wxFgetc _fgettc
341 #define wxFgetchar _fgettchar
342 #define wxFgets _fgetts
343 #if wxUSE_UNICODE_MSLU
344 WXDLLIMPEXP_BASE
FILE * wxMSLU__tfopen(const wxChar
*name
, const wxChar
*mode
);
346 #define wxFopen wxMSLU__tfopen
348 #define wxFopen _tfopen
350 #define wxFputc _fputtc
351 #define wxFputchar _fputtchar
352 #define wxFprintf _ftprintf
353 #define wxFputs _fputts
354 #define wxFreopen _tfreopen
355 #define wxFscanf _ftscanf
356 #define wxGetc _gettc
357 #define wxGetchar _gettchar
358 #define wxGets _getts
359 #define wxPerror _tperror
360 #define wxPrintf _tprintf
361 #define wxPutc(c,f) _puttc(WXWCHAR_T_CAST(c),f)
362 #define wxPutchar _puttchar
363 #define wxPuts _putts
364 #define wxScanf _tscanf
367 /* Digital Mars adds count to _stprintf (C99) so prototype conversion see wxchar.cpp */
368 int wxSprintf (wchar_t * __RESTRICT s
, const wchar_t * __RESTRICT format
, ... ) ;
370 /* and there is a bug in D Mars tchar.h prior to 8.39.4n, so define as sprintf */
371 #define wxSprintf sprintf
374 #define wxSprintf _stprintf
377 #define wxSscanf _stscanf
378 #define wxTmpnam _ttmpnam
379 #define wxUngetc _tungetc
380 #define wxVfprintf _vftprintf
381 #define wxVprintf _vtprintf
382 #define wxVsscanf _vstscanf
383 #define wxVsprintf _vstprintf
385 /* special case: these functions are missing under Win9x with Unicows so we */
386 /* have to implement them ourselves */
387 #if wxUSE_UNICODE_MSLU
388 WXDLLIMPEXP_BASE
int wxMSLU__trename(const wxChar
*oldname
, const wxChar
*newname
);
389 WXDLLIMPEXP_BASE
int wxMSLU__tremove(const wxChar
*name
);
391 #define wxRemove wxMSLU__tremove
392 #define wxRename wxMSLU__trename
395 /* carefully: wxRemove() must return 0 on success while DeleteFile()
396 returns 0 on error, so don't just define one as the other */
397 int wxRemove(const wxChar
*path
);
399 #define wxRemove _tremove
400 #define wxRename _trename
404 /* stdlib.h functions */
407 /* #define wxAtof _tttof -- notice that there is no such thing (why?) */
408 /* there are no env vars at all under CE, so no _tgetenv neither */
410 /* can't define as inline function as this is a C file... */
411 #define wxGetenv(name) ((wxChar *)NULL)
413 #define wxGetenv _tgetenv
415 #define wxSystem _tsystem
417 /* time.h functions */
418 #define wxAsctime _tasctime
419 #define wxCtime _tctime
421 #define wxMbstowcs mbstowcs
422 #define wxWcstombs wcstombs
423 #else /* !TCHAR-aware compilers */
425 There are 2 unrelated problems with these functions under Mac:
426 a) Metrowerks MSL CRT implements them strictly in C99 sense and
427 doesn't support (very common) extension of allowing to call
428 mbstowcs(NULL, ...) which makes it pretty useless as you can't
429 know the size of the needed buffer
430 b) OS X <= 10.2 declares and even defined these functions but
431 doesn't really implement them -- they always return an error
433 So use our own replacements in both cases.
435 #if defined(__MWERKS__) && defined(__MSL__)
436 #define wxNEED_WX_MBSTOWCS
440 #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2
441 #define wxNEED_WX_MBSTOWCS
445 #ifdef wxNEED_WX_MBSTOWCS
446 /* even though they are defined and "implemented", they are bad and just
447 stubs so we need our own - we need these even in ANSI builds!! */
448 WXDLLIMPEXP_BASE
size_t wxMbstowcs (wchar_t *, const char *, size_t);
449 WXDLLIMPEXP_BASE
size_t wxWcstombs (char *, const wchar_t *, size_t);
451 #define wxMbstowcs mbstowcs
452 #define wxWcstombs wcstombs
456 The system C library on Mac OS X 10.2 and below does not support
457 unicode: in other words all wide-character functions such as towupper et
458 al. do simply not exist so we need to provide our own in that context,
459 except for the wchar_t definition/typedef itself.
461 We need to do this for both project builder and CodeWarrior as
462 the latter uses the system C library in Mach builds for wide character
463 support, which as mentioned does not exist on 10.2 and below.
465 #if wxUSE_UNICODE && \
466 defined(__DARWIN__) && \
467 ( MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 )
468 /* we need everything! */
469 #define wxNEED_WX_STRING_H
470 #define wxNEED_WX_CTYPE_H
472 #define wxFgetchar(c) wxFgetc(c, stdin)
473 #define wxFputc wxPutc
474 #define wxFputchar(c) wxPutc(c, stdout)
475 #define wxGetc wxFgetc
476 #define wxGetchar(c) wxFgetc(c, stdin)
483 #define wxNEED_UNGETC
489 int wxFputs(const wxChar
*ch
, FILE *stream
);
490 int wxPuts(const wxChar
*ws
);
491 int wxPutc(wxChar ch
, FILE *stream
);
496 WXDLLIMPEXP_BASE
size_t wxStrlen_(const wxChar
*s
);
501 #define wxPutchar(wch) wxPutc(wch, stdout)
503 #define wxNEED_PRINTF_CONVERSION
504 #define wxNEED_WX_STDIO_H
505 #define wxNEED_WX_STDLIB_H
506 #define wxNEED_WX_TIME_H
511 /* this is probably glibc-specific */
512 #if defined(__WCHAR_TYPE__) && !defined(__MWERKS__)
513 /* ctype.h functions (wctype.h) */
514 #define wxIsalnum iswalnum
515 #define wxIsalpha iswalpha
516 #define wxIscntrl iswcntrl
517 #define wxIsdigit iswdigit
518 #define wxIsgraph iswgraph
519 #define wxIslower iswlower
520 #define wxIsprint iswprint
521 #define wxIspunct iswpunct
522 #define wxIsspace iswspace
523 #define wxIsupper iswupper
524 #define wxIsxdigit iswxdigit
526 #if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
527 /* /usr/include/wctype.h incorrectly declares translations */
528 /* tables which provokes tons of compile-time warnings -- try */
529 /* to correct this */
530 #define wxTolower(wc) towctrans((wc), (wctrans_t)__ctype_tolower)
531 #define wxToupper(wc) towctrans((wc), (wctrans_t)__ctype_toupper)
532 #else /* !glibc 2.0 */
533 #define wxTolower towlower
534 #define wxToupper towupper
535 #endif /* gcc/!gcc */
537 /* string.h functions (wchar.h) */
538 #define wxStrcat wcscat
539 #define wxStrchr wcschr
540 #define wxStrcmp wcscmp
541 #define wxStrcoll wcscoll
542 #define wxStrcpy wcscpy
543 #define wxStrcspn wcscspn
544 #define wxStrlen_ wxWcslen /* wxStrlen_() is used in wxStrlen() */
545 #define wxStrncat wcsncat
546 #define wxStrncmp wcsncmp
547 #define wxStrncpy wcsncpy
548 #define wxStrpbrk wcspbrk
549 #define wxStrrchr wcsrchr
550 #define wxStrspn wcsspn
551 #define wxStrstr wcsstr
552 #define wxStrtod wcstod
553 #define wxStrtol wcstol
554 #define wxStrtoul wcstoul
556 /* assume that we have wcstoull(), which is also C99, too */
557 #define wxStrtoll wcstoll
558 #define wxStrtoull wcstoull
559 #endif /* HAVE_WCSTOULL */
560 #define wxStrxfrm wcsxfrm
562 #define wxFgetc fgetwc
563 #define wxFgetchar fgetwchar
564 #define wxFgets fgetws
565 #define wxFputc fputwc
566 #define wxFputchar fputwchar
568 #define wxGetchar getwchar
570 #define wxUngetc ungetwc
573 #define wxFputs fputws
577 int wxFputs(const wxChar
*ch
, FILE *stream
);
585 int wxPutc(wxChar ch
, FILE *stream
);
589 #define wxPutchar wputchar
591 #define wxPutchar(wch) wxPutc(wch, stdout)
598 int wxPuts(const wxChar
*ws
);
601 /* we need %s to %ls conversion for printf and scanf etc */
602 #define wxNEED_PRINTF_CONVERSION
604 /* glibc doesn't have wide char equivalents of the other stuff so */
605 /* use our own versions */
606 #define wxNEED_WX_STDIO_H
607 #define wxNEED_WX_STDLIB_H
608 #define wxNEED_WX_TIME_H
609 #elif defined(__MWERKS__) && ( defined(__MSL__) || defined(__MACH__) )
610 /* ctype.h functions (wctype.h) */
611 #define wxIsalnum iswalnum
612 #define wxIsalpha iswalpha
613 #define wxIscntrl iswcntrl
614 #define wxIsdigit iswdigit
615 #define wxIsgraph iswgraph
616 #define wxIslower iswlower
617 #define wxIsprint iswprint
618 #define wxIspunct iswpunct
619 #define wxIsspace iswspace
620 #define wxIsupper iswupper
621 #define wxIsxdigit iswxdigit
622 #define wxTolower towlower
623 #define wxToupper towupper
625 /* string.h functions (wchar.h) */
626 #define wxStrcat wcscat
627 #define wxStrchr wcschr
628 #define wxStrcmp wcscmp
629 #define wxStrcoll wcscoll
630 #define wxStrcpy wcscpy
631 #define wxStrcspn wcscspn
632 #define wxStrlen_ wxWcslen /* wxStrlen_() is used in wxStrlen() */
633 #define wxStrncat wcsncat
634 #define wxStrncmp wcsncmp
635 #define wxStrncpy wcsncpy
636 #define wxStrpbrk wcspbrk
637 #define wxStrrchr wcsrchr
638 #define wxStrspn wcsspn
639 #define wxStrstr wcsstr
640 #define wxStrtod wcstod
641 #define wxStrtol wcstol
642 #define wxStrtoul wcstoul
643 #define wxStrxfrm wcsxfrm
645 #define wxFgetc fgetwc
646 #define wxFgetchar fgetwchar
647 #define wxFgets fgetws
648 #define wxFputc fputwc
649 #define wxFputchar fputwchar
651 #define wxGetchar getwchar
653 #define wxUngetc ungetwc
655 #define wxNEED_PRINTF_CONVERSION
658 #define wxPutchar putwchar
659 #define wxFputs fputws
661 /* stdio.h functions */
663 #define wxNEED_WX_STDIO_H
665 /* stdlib.h functions */
667 #define wxNEED_WX_STDLIB_H
672 #define wxGetenv(a) ((wxChar*)NULL)
673 #define wxSystem(a) ((int)NULL)
675 /* time.h functions */
676 #define wxAsctime wasciitime
677 #define wxCtime wctime
678 /* #define wxStrftime wcsftime */
680 #define wxNEED_WX_TIME_H
681 #else /* !metrowerks for apple */
682 #error "Please define wide character functions for your environment"
688 /* ctype.h functions */
689 #define wxIsalnum isalnum
690 #define wxIsalpha isalpha
691 #define wxIscntrl iscntrl
692 #define wxIsdigit isdigit
693 #define wxIsgraph isgraph
694 #define wxIslower islower
695 #define wxIsprint isprint
696 #define wxIspunct ispunct
697 #define wxIsspace isspace
698 #define wxIsupper isupper
699 #define wxIsxdigit isxdigit
700 #define wxTolower tolower
701 #define wxToupper toupper
703 /* locale.h functons */
704 #define wxSetlocale setlocale
706 /* string.h functions */
707 #define wxStrcat strcat
708 #define wxStrchr strchr
709 #define wxStrcmp strcmp
710 #define wxStrcoll strcoll
711 #define wxStrcpy strcpy
712 #define wxStrcspn strcspn
714 /* wxStricmp and wxStrnicmp are defined below */
715 #define wxStrlen_ strlen /* used in wxStrlen inline function */
716 #define wxStrncat strncat
717 #define wxStrncmp strncmp
718 #define wxStrncpy strncpy
719 #define wxStrpbrk strpbrk
720 #define wxStrrchr strrchr
721 #define wxStrspn strspn
722 #define wxStrstr strstr
723 #define wxStrtod strtod
725 #define wxStrtok(str, sep, last) strtok_r(str, sep, last)
727 #define wxStrtol strtol
728 #define wxStrtoul strtoul
730 /* assume that we have wcstoull(), which is also C99, too */
731 #define wxStrtoll strtoll
732 #define wxStrtoull strtoull
733 #endif /* HAVE_WCSTOULL */
734 #define wxStrxfrm strxfrm
736 /* stdio.h functions */
737 #define wxFopen fopen
738 #define wxFreopen freopen
739 #define wxRemove remove
740 #define wxRename rename
742 #define wxPerror perror
743 #define wxTmpnam tmpnam
745 #define wxFgetc fgetc
746 #define wxFgetchar fgetchar
747 #define wxFgets fgets
748 #define wxFputc fputc
749 #define wxFputs fputs
750 #define wxFputchar fputchar
751 #define wxFprintf fprintf
752 #define wxFscanf fscanf
754 #define wxGetchar getchar
756 #define wxPrintf printf
758 #define wxPutchar putchar
760 #define wxScanf scanf
761 #define wxSprintf sprintf
762 #define wxSscanf sscanf
763 #define wxUngetc ungetc
764 #define wxVfprintf vfprintf
765 #define wxVprintf vprintf
766 #define wxVsscanf vsscanf
767 #define wxVsprintf vsprintf
769 /* stdlib.h functions */
773 #define wxGetenv getenv
774 #define wxSystem system
776 /* time.h functions */
777 #define wxAsctime asctime
778 #define wxCtime ctime
779 #define wxStrftime strftime
780 #endif /* Unicode/ASCII */
781 #endif /* TCHAR-aware compilers/the others */
784 #define wxHAS_STRTOLL
788 various special cases
791 /* define wxStricmp and wxStrnicmp for various compilers */
793 /* note that in Unicode mode we definitely are going to need our own version */
794 #if !defined(wxStricmp) && !wxUSE_UNICODE
795 #if defined(__BORLANDC__) || defined(__WATCOMC__) || \
796 defined(__SALFORDC__) || defined(__VISAGECPP__) || \
797 defined(__EMX__) || defined(__DJGPP__)
798 #define wxStricmp stricmp
799 #define wxStrnicmp strnicmp
800 #elif defined(__WXPALMOS__)
801 /* FIXME: There is no equivalent to strnicmp in the Palm OS API. This
802 * quick hack should do until one can be written.
804 #define wxStricmp StrCaselessCompare
805 #define wxStrnicmp strnicmp
806 #elif defined(__SYMANTEC__) || defined(__VISUALC__) || \
807 (defined(__MWERKS__) && defined(__INTEL__))
808 #define wxStricmp _stricmp
809 #define wxStrnicmp _strnicmp
810 #elif defined(__UNIX__) || defined(__GNUWIN32__)
811 #define wxStricmp strcasecmp
812 #define wxStrnicmp strncasecmp
813 /* #else -- use wxWidgets implementation */
815 #endif /* !defined(wxStricmp) */
817 /* define wxWcslen() which should be always available if wxUSE_WCHAR_T == 1 (as */
818 /* it's used in wx/buffer.h -- and also might be used just below by wxStrlen() */
819 /* when wxStrlen_() is #define'd as wxWcslen so do it before defining wxStrlen) */
822 #define wxWcslen wcslen
824 WXDLLIMPEXP_BASE
size_t wxWcslen(const wchar_t *s
);
826 #endif /* wxUSE_WCHAR_T */
829 /* checks whether the passed in pointer is NULL and if the string is empty */
830 inline bool wxIsEmpty(const wxChar
*p
) { return !p
|| !*p
; }
832 /* safe version of strlen() (returns 0 if passed NULL pointer) */
833 inline size_t wxStrlen(const wxChar
*psz
) { return psz
? wxStrlen_(psz
) : 0; }
837 each of strdup() and wcsdup() may or may not be available but we need both
838 of them anyhow for wx/buffer.h so we define the missing one(s) in
839 wxchar.cpp and so we should always have both wxStrdupA and wxStrdupW
840 defined -- if this is somehow not the case in some situations, please
841 correct that and not the lines here
844 #define wxStrdup wxStrdupW
846 #define wxStrdup wxStrdupA
850 WXDLLIMPEXP_BASE
bool wxOKlibc(); /* for internal use */
853 /* printf() family saga */
856 For some systems [v]snprintf() exists in the system libraries but not in the
857 headers, so we need to declare it ourselves to be able to use it.
859 #if defined(HAVE_VSNPRINTF) && !defined(HAVE_VSNPRINTF_DECL)
865 int vsnprintf(char *str
, size_t size
, const char *format
, va_list ap
);
866 #endif /* !HAVE_VSNPRINTF_DECL */
868 #if defined(HAVE_SNPRINTF) && !defined(HAVE_SNPRINTF_DECL)
874 WXDLLIMPEXP_BASE
int snprintf(char *str
, size_t size
, const char *format
, ...);
875 #endif /* !HAVE_SNPRINTF_DECL */
877 /* Wrapper for vsnprintf if it's 3rd parameter is non-const. Note: the
878 * same isn't done for snprintf below, the builtin wxSnprintf_ is used
879 * instead since it's already a simple wrapper */
880 #if defined __cplusplus && defined HAVE_BROKEN_VSNPRINTF_DECL
881 inline int wx_fixed_vsnprintf(char *str
, size_t size
, const char *format
, va_list ap
)
883 return vsnprintf(str
, size
, (char*)format
, ap
);
888 MinGW MSVCRT has non-standard vswprintf() (for MSVC compatibility
889 presumably) and normally _vsnwprintf() is used instead
891 #if defined(HAVE_VSWPRINTF) && defined(__MINGW32__)
892 #undef HAVE_VSWPRINTF
895 #if wxUSE_PRINTF_POS_PARAMS
897 The systems where vsnprintf() supports positional parameters should
898 define the HAVE_UNIX98_PRINTF symbol.
900 On systems which don't (e.g. Windows) we are forced to use
901 our wxVsnprintf() implementation.
903 #if defined(HAVE_UNIX98_PRINTF)
905 #ifdef HAVE_VSWPRINTF
906 #define wxVsnprintf_ vswprintf
909 #ifdef HAVE_BROKEN_VSNPRINTF_DECL
910 #define wxVsnprintf_ wx_fixed_vsnprintf
912 #define wxVsnprintf_ vsnprintf
915 #else /* !HAVE_UNIX98_PRINTF */
917 The only compiler with positional parameters support under Windows
918 is VC++ 8.0 which provides a new xxprintf_p() functions family.
919 The 2003 PSDK includes a slightly earlier version of VC8 than the
920 main release and does not have the printf_p functions.
922 #if defined _MSC_FULL_VER && _MSC_FULL_VER >= 140050727 && !defined __WXWINCE__
924 #define wxVsnprintf_ _vswprintf_p
926 #define wxVsnprintf_ _vsprintf_p
929 #endif /* HAVE_UNIX98_PRINTF/!HAVE_UNIX98_PRINTF */
930 #else /* !wxUSE_PRINTF_POS_PARAMS */
932 We always want to define safe snprintf() function to be used instead of
933 sprintf(). Some compilers already have it (or rather vsnprintf() which
934 we really need...), otherwise we implement it using our own printf()
937 We define function with a trailing underscore here because the real one
938 is a wrapper around it as explained below
941 /* first deal with TCHAR-aware compilers which have _vsntprintf */
943 #if defined(__VISUALC__) || \
944 (defined(__BORLANDC__) && __BORLANDC__ >= 0x540)
945 #define wxVsnprintf_ _vsntprintf
946 #define wxSnprintf_ _sntprintf
950 /* if this didn't work, define it separately for Unicode and ANSI builds */
953 #if defined(HAVE__VSNWPRINTF)
954 #define wxVsnprintf_ _vsnwprintf
955 #elif defined(HAVE_VSWPRINTF)
956 #define wxVsnprintf_ vswprintf
957 #elif defined(__WATCOMC__)
958 #define wxVsnprintf_ _vsnwprintf
959 #define wxSnprintf_ _snwprintf
963 All versions of CodeWarrior supported by wxWidgets apparently
964 have both snprintf() and vsnprintf()
966 #if defined(HAVE_SNPRINTF) \
967 || defined(__MWERKS__) || defined(__WATCOMC__)
968 #ifndef HAVE_BROKEN_SNPRINTF_DECL
969 #define wxSnprintf_ snprintf
972 #if defined(HAVE_VSNPRINTF) \
973 || defined(__MWERKS__) || defined(__WATCOMC__)
974 #ifdef HAVE_BROKEN_VSNPRINTF_DECL
975 #define wxVsnprintf_ wx_fixed_vsnprintf
977 #define wxVsnprintf_ vsnprintf
980 #endif /* Unicode/ASCII */
981 #endif /* wxVsnprintf_ */
982 #endif /* wxUSE_PRINTF_POS_PARAMS/!wxUSE_PRINTF_POS_PARAMS */
985 /* no [v]snprintf(), cook our own */
987 wxSnprintf_(wxChar
*buf
, size_t len
, const wxChar
*format
, ...) ATTRIBUTE_PRINTF_3
;
991 wxVsnprintf_(wxChar
*buf
, size_t len
, const wxChar
*format
, va_list argptr
);
995 In Unicode mode we need to have all standard functions such as wprintf() and
996 so on but not all systems have them so use our own implementations in this
999 #if wxUSE_UNICODE && !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_WPRINTF)
1000 #define wxNEED_WPRINTF
1004 More Unicode complications: although both ANSI C and C++ define a number of
1005 wide character functions such as wprintf(), not all environments have them.
1006 Worse, those which do have different behaviours: under Windows, %s format
1007 specifier changes its meaning in Unicode build and expects a Unicode string
1008 while under Unix/POSIX it still means an ASCII string even for wprintf() and
1009 %ls has to be used for wide strings.
1011 We choose to always emulate Windows behaviour as more useful for us so even
1012 if we have wprintf() we still must wrap it in a non trivial wxPrintf().
1016 #if defined(wxNEED_PRINTF_CONVERSION) || defined(wxNEED_WPRINTF)
1018 we need to implement all wide character printf and scanf functions
1019 either because we don't have them at all or because they don't have the
1022 int wxScanf( const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_1
;
1023 int wxSscanf( const wxChar
*str
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_2
;
1024 int wxFscanf( FILE *stream
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_2
;
1025 int wxVsscanf( const wxChar
*str
, const wxChar
*format
, va_list ap
);
1026 int wxPrintf( const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_1
;
1027 int wxSprintf( wxChar
*str
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_2
;
1028 int wxFprintf( FILE *stream
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_2
;
1029 int wxVfprintf( FILE *stream
, const wxChar
*format
, va_list ap
);
1030 int wxVprintf( const wxChar
*format
, va_list ap
);
1031 int wxVsprintf( wxChar
*str
, const wxChar
*format
, va_list ap
);
1032 #endif /* wxNEED_PRINTF_CONVERSION */
1034 /* these 2 can be simply mapped to the versions with underscore at the end */
1035 /* if we don't have to do the conversion */
1037 However, if we don't have any vswprintf() at all we don't need to redefine
1038 anything as our own wxVsnprintf_() already behaves as needed.
1040 #if defined(wxNEED_PRINTF_CONVERSION) && defined(wxVsnprintf_)
1041 int wxSnprintf( wxChar
*str
, size_t size
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_3
;
1042 int wxVsnprintf( wxChar
*str
, size_t size
, const wxChar
*format
, va_list ap
);
1044 #define wxSnprintf wxSnprintf_
1045 #define wxVsnprintf wxVsnprintf_
1049 various functions which might not be available in libc and for which we
1050 provide our own replacements in wxchar.cpp
1053 /* ctype.h functions */
1055 /* RN: Used only under OSX <= 10.2 currently */
1056 #ifdef wxNEED_WX_CTYPE_H
1057 WXDLLIMPEXP_BASE
int wxIsalnum(wxChar ch
);
1058 WXDLLIMPEXP_BASE
int wxIsalpha(wxChar ch
);
1059 WXDLLIMPEXP_BASE
int wxIscntrl(wxChar ch
);
1060 WXDLLIMPEXP_BASE
int wxIsdigit(wxChar ch
);
1061 WXDLLIMPEXP_BASE
int wxIsgraph(wxChar ch
);
1062 WXDLLIMPEXP_BASE
int wxIslower(wxChar ch
);
1063 WXDLLIMPEXP_BASE
int wxIsprint(wxChar ch
);
1064 WXDLLIMPEXP_BASE
int wxIspunct(wxChar ch
);
1065 WXDLLIMPEXP_BASE
int wxIsspace(wxChar ch
);
1066 WXDLLIMPEXP_BASE
int wxIsupper(wxChar ch
);
1067 WXDLLIMPEXP_BASE
int wxIsxdigit(wxChar ch
);
1068 WXDLLIMPEXP_BASE
int wxTolower(wxChar ch
);
1069 WXDLLIMPEXP_BASE
int wxToupper(wxChar ch
);
1070 #endif /* wxNEED_WX_CTYPE_H */
1072 /* under VC++ 6.0 isspace() returns 1 for 8 bit chars which completely breaks */
1073 /* the file parsing -- this may be true for 5.0 as well, update #ifdef then */
1074 #if defined(__VISUALC__) && (__VISUALC__ >= 1200) && !wxUSE_UNICODE
1076 #define wxIsspace(c) ((((unsigned)c) < 128) && isspace(c))
1080 a few compilers don't have the (non standard but common) isascii function,
1081 define it ourselves for them
1084 #if defined(__MWERKS__)
1085 #define wxNEED_ISASCII
1086 #elif defined(_WIN32_WCE)
1087 #if _WIN32_WCE <= 211
1088 #define wxNEED_ISASCII
1091 #endif /* isascii */
1093 #ifdef wxNEED_ISASCII
1094 inline int isascii(int c
) { return (unsigned)c
< 0x80; }
1098 #if _WIN32_WCE <= 211
1099 #define isspace(c) ((c) == _T(' ') || (c) == _T('\t'))
1101 #endif /* _WIN32_WCE */
1104 we had goofed and defined wxIsctrl() instead of (correct) wxIscntrl() in the
1105 initial versions of this header -- now it is too late to remove it so
1106 although we fixed the function/macro name above, still provide the
1107 backwards-compatible synonym.
1109 #define wxIsctrl wxIscntrl
1111 /* string.h functions */
1113 #if defined(__MWERKS__) && !defined(__MACH__) && (__MSL__ < 0x00008000)
1114 #define wxNEED_STRDUP
1115 #elif defined(__WXWINCE__)
1116 #if _WIN32_WCE <= 211
1117 #define wxNEED_STRDUP
1122 #ifdef wxNEED_STRDUP
1123 WXDLLIMPEXP_BASE
char *strdup(const char* s
);
1126 /* RN: Used only under OSX <= 10.2 currently
1127 The __cplusplus ifdefs are messy, but they are required to build
1128 the regex library, since c does not support function overloading
1130 #ifdef wxNEED_WX_STRING_H
1134 WXDLLIMPEXP_BASE wxChar
* wxStrcat(wxChar
*dest
, const wxChar
*src
);
1135 WXDLLIMPEXP_BASE
const wxChar
* wxStrchr(const wxChar
*s
, wxChar c
);
1136 WXDLLIMPEXP_BASE
int wxStrcmp(const wxChar
*s1
, const wxChar
*s2
);
1137 WXDLLIMPEXP_BASE
int wxStrcoll(const wxChar
*s1
, const wxChar
*s2
);
1138 WXDLLIMPEXP_BASE wxChar
* wxStrcpy(wxChar
*dest
, const wxChar
*src
);
1139 WXDLLIMPEXP_BASE
size_t wxStrcspn(const wxChar
*s
, const wxChar
*reject
);
1140 WXDLLIMPEXP_BASE wxChar
* wxStrncat(wxChar
*dest
, const wxChar
*src
, size_t n
);
1141 WXDLLIMPEXP_BASE
int wxStrncmp(const wxChar
*s1
, const wxChar
*s2
, size_t n
);
1142 WXDLLIMPEXP_BASE wxChar
* wxStrncpy(wxChar
*dest
, const wxChar
*src
, size_t n
);
1143 WXDLLIMPEXP_BASE
const wxChar
* wxStrpbrk(const wxChar
*s
, const wxChar
*accept
);
1144 WXDLLIMPEXP_BASE
const wxChar
* wxStrrchr(const wxChar
*s
, wxChar c
);
1145 WXDLLIMPEXP_BASE
size_t wxStrspn(const wxChar
*s
, const wxChar
*accept
);
1146 WXDLLIMPEXP_BASE
const wxChar
* wxStrstr(const wxChar
*haystack
, const wxChar
*needle
);
1151 /* These functions use C++, so we can't c extern them */
1152 WXDLLIMPEXP_BASE
double wxStrtod(const wxChar
*nptr
, wxChar
**endptr
);
1153 WXDLLIMPEXP_BASE
long int wxStrtol(const wxChar
*nptr
, wxChar
**endptr
, int base
);
1154 WXDLLIMPEXP_BASE
unsigned long int wxStrtoul(const wxChar
*nptr
, wxChar
**endptr
, int base
);
1155 WXDLLIMPEXP_BASE
size_t wxStrxfrm(wxChar
*dest
, const wxChar
*src
, size_t n
);
1157 /* inlined versions */
1159 inline wxChar
* wxStrchr(wxChar
*s
, wxChar c
)
1160 { return (wxChar
*)wxStrchr((const wxChar
*)s
, c
); }
1161 inline wxChar
* wxStrpbrk(wxChar
*s
, const wxChar
*accept
)
1162 { return (wxChar
*)wxStrpbrk((const wxChar
*)s
, accept
); }
1163 inline wxChar
* wxStrrchr(wxChar
*s
, wxChar c
)
1164 { return (wxChar
*)wxStrrchr((const wxChar
*)s
, c
); }
1165 inline wxChar
*wxStrstr(wxChar
*haystack
, const wxChar
*needle
)
1166 { return (wxChar
*)wxStrstr((const wxChar
*)haystack
, needle
); }
1169 #endif /* wxNEED_WX_STRING_H */
1172 WXDLLIMPEXP_BASE
char *wxStrdupA(const char *psz
);
1176 WXDLLIMPEXP_BASE
wchar_t *wxStrdupW(const wchar_t *pwz
);
1180 WXDLLIMPEXP_BASE
int wxStricmp(const wxChar
*psz1
, const wxChar
*psz2
);
1184 WXDLLIMPEXP_BASE
int wxStrnicmp(const wxChar
*psz1
, const wxChar
*psz2
, size_t len
);
1188 WXDLLIMPEXP_BASE wxChar
* wxStrtok(wxChar
*psz
, const wxChar
*delim
, wxChar
**save_ptr
);
1193 class WXDLLIMPEXP_BASE wxWCharBuffer
;
1194 WXDLLIMPEXP_BASE wxWCharBuffer
wxSetlocale(int category
, const wxChar
*locale
);
1198 /* stdio.h functions */
1199 #ifdef wxNEED_WX_STDIO_H
1201 WXDLLIMPEXP_BASE
FILE * wxFopen(const wxChar
*path
, const wxChar
*mode
);
1202 WXDLLIMPEXP_BASE
FILE * wxFreopen(const wxChar
*path
, const wxChar
*mode
, FILE *stream
);
1203 WXDLLIMPEXP_BASE
int wxRemove(const wxChar
*path
);
1204 WXDLLIMPEXP_BASE
int wxRename(const wxChar
*oldpath
, const wxChar
*newpath
);
1206 /* *printf() family is handled separately */
1207 #endif /* wxNEED_WX_STDIO_H */
1210 /* stdlib.h functions */
1212 WXDLLIMPEXP_BASE
double wxAtof(const wxChar
*psz
);
1215 #ifdef wxNEED_WX_STDLIB_H
1216 WXDLLIMPEXP_BASE
int wxAtoi(const wxChar
*psz
);
1217 WXDLLIMPEXP_BASE
long wxAtol(const wxChar
*psz
);
1218 WXDLLIMPEXP_BASE wxChar
* wxGetenv(const wxChar
*name
);
1219 WXDLLIMPEXP_BASE
int wxSystem(const wxChar
*psz
);
1223 /* time.h functions */
1224 #ifdef wxNEED_WX_TIME_H
1225 #if defined(__MWERKS__) && defined(macintosh)
1228 /*silent gabby compilers*/
1230 WXDLLIMPEXP_BASE
size_t wxStrftime(wxChar
*s
, size_t max
,
1231 const wxChar
*fmt
, const struct tm
*tm
);
1232 #endif /* wxNEED_WX_TIME_H */
1236 WXDLLIMPEXP_BASE wxChar
*wxCtime(const time_t *timep
);
1240 /* missing functions in some WinCE versions */
1242 #if (_WIN32_WCE < 300)
1243 WXDLLIMPEXP_BASE
void *calloc( size_t num
, size_t size
);
1245 #endif /* _WIN32_WCE */
1247 /* multibyte to wide char conversion functions and macros */
1250 /* multibyte<->widechar conversion */
1251 WXDLLIMPEXP_BASE
size_t wxMB2WC(wchar_t *buf
, const char *psz
, size_t n
);
1252 WXDLLIMPEXP_BASE
size_t wxWC2MB(char *buf
, const wchar_t *psz
, size_t n
);
1255 #define wxMB2WX wxMB2WC
1256 #define wxWX2MB wxWC2MB
1257 #define wxWC2WX wxStrncpy
1258 #define wxWX2WC wxStrncpy
1260 #define wxMB2WX wxStrncpy
1261 #define wxWX2MB wxStrncpy
1262 #define wxWC2WX wxWC2MB
1263 #define wxWX2WC wxMB2WC
1265 #else /* !wxUSE_UNICODE */
1266 /* Why is this here?
1268 /* No wxUSE_WCHAR_T: we have to do something (JACS) */
1269 #define wxMB2WC wxStrncpy
1270 #define wxWC2MB wxStrncpy
1271 #define wxMB2WX wxStrncpy
1272 #define wxWX2MB wxStrncpy
1273 #define wxWC2WX wxWC2MB
1274 #define wxWX2WC wxMB2WC
1278 RN: The following are not normal versions of memcpy et al., rather
1279 these are either char or widechar versions depending on
1280 if unicode is used or not.
1286 // RN: We could do the usual tricky compiler detection here,
1287 // and use their variant (such as wmemchr, etc.). The problem
1288 // is that these functions are quite rare, even though they are
1289 // part of the current POSIX standard. In addition, most compilers
1290 // (including even MSC) inline them just like we do right in their
1294 #include <string.h> //for mem funcs
1296 //implement our own wmem variants
1297 inline wxChar
* wxTmemchr(const wxChar
* s
, wxChar c
, size_t l
)
1299 for(;l
&& *s
!= c
;--l
, ++s
) {}
1306 inline int wxTmemcmp(const wxChar
* sz1
, const wxChar
* sz2
, size_t len
)
1308 for(; *sz1
== *sz2
&& len
; --len
, ++sz1
, ++sz2
) {}
1311 return *sz1
< *sz2
? -1 : *sz1
> *sz2
;
1316 inline wxChar
* wxTmemcpy(wxChar
* szOut
, const wxChar
* szIn
, size_t len
)
1318 return (wxChar
*) memcpy(szOut
, szIn
, len
* sizeof(wxChar
));
1321 inline wxChar
* wxTmemmove(wxChar
* szOut
, const wxChar
* szIn
, size_t len
)
1323 return (wxChar
*) memmove(szOut
, szIn
, len
* sizeof(wxChar
));
1326 inline wxChar
* wxTmemset(wxChar
* szOut
, const wxChar cIn
, size_t len
)
1328 wxChar
* szRet
= szOut
;
1336 #else /* !wxUSE_UNICODE */
1337 # define wxTmemchr memchr
1338 # define wxTmemcmp memcmp
1339 # define wxTmemcpy memcpy
1340 # define wxTmemmove memmove
1341 # define wxTmemset memset
1342 #endif /* wxUSE_UNICODE/!wxUSE_UNICODE */
1344 #endif /*__cplusplus*/
1347 #endif /* _WX_WXCHAR_H_ */