]> git.saurik.com Git - wxWidgets.git/blob - include/wx/wxchar.h
applied Unicode fixes for mingw32 (patch 429654)
[wxWidgets.git] / include / wx / wxchar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wxchar.h
3 // Purpose: Declarations common to wx char/wchar_t usage (wide chars)
4 // Author: Joel Farley
5 // Modified by:
6 // Created: 1998/06/12
7 // RCS-ID: $Id$
8 // Copyright: (c) wxWindows copyright
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_WXCHAR_H_
13 #define _WX_WXCHAR_H_
14
15 #ifdef __GNUG__
16 #pragma interface "wxchar.h"
17 #endif
18
19 // only do SBCS or _UNICODE
20 #if defined (_MBCS )
21 // It may be OK anyway.
22 // # error "MBCS is not supported by wxChar"
23 #endif
24
25 // ----------------------------------------------------------------------------
26 // first deal with Unicode setting
27 // ----------------------------------------------------------------------------
28
29 // set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined
30 #if defined(_UNICODE) || defined(UNICODE)
31 # undef wxUSE_UNICODE
32 # define wxUSE_UNICODE 1
33 #else
34 # ifndef wxUSE_UNICODE
35 # define wxUSE_UNICODE 0
36 # endif
37 #endif // Unicode
38
39 // and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1...
40 #if wxUSE_UNICODE
41 # ifndef _UNICODE
42 # define _UNICODE
43 # endif
44 # ifndef UNICODE
45 # define UNICODE
46 # endif
47 #endif // Unicode
48
49 // Unicode support requires wchar_t
50 #if wxUSE_UNICODE
51 # undef wxUSE_WCHAR_T
52 # define wxUSE_WCHAR_T 1
53 #endif // Unicode
54
55 // ----------------------------------------------------------------------------
56 // define wxHAVE_TCHAR_FUNCTIONS for the compilers which support the
57 // wide-character functions
58 // ----------------------------------------------------------------------------
59
60 #ifdef __WIN32__
61 // VC++ and BC++ starting with 5.2 have TCHAR support
62 #ifdef __VISUALC__
63 #define wxHAVE_TCHAR_FUNCTIONS
64 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)
65 #define wxHAVE_TCHAR_FUNCTIONS
66 #elif defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 0, 6 )
67 #define wxHAVE_TCHAR_FUNCTIONS
68 #include <stddef.h>
69 #include <string.h>
70 #include <ctype.h>
71 #endif
72 #elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
73 // VisualAge 4.0+ supports TCHAR
74 #define wxHAVE_TCHAR_FUNCTIONS
75
76 // but not stdio.h nor time nor conversion functions
77 #define wxNO_TCHAR_STDIO
78 #define wxNO_TCHAR_STDLIB
79 #define wxNO_TCHAR_TIME
80 #define wxNO_TCHAR_LOCALE
81 //
82 // supplemental VA V4 defs so at least we know what these are
83 // just define to standard defs
84 //
85
86 // for wcslen
87 #include <wchar.h>
88
89 // locale.h functons -- not defined in tchar.h
90 #define wxSetlocale setlocale
91 // some stdio functions are defined others are not
92 // these are not
93 #define wxFgetchar fgetchar
94 #define wxFopen fopen
95 #define wxFputchar fputchar
96 #define wxFreopen freopen
97 #define wxGets gets
98 #define wxPerror perror
99 #define wxPuts puts
100 #define wxRemove remove
101 #define wxRename rename
102 #define wxTmpnam tmpnam
103 #define wxUngetc ungetc
104 #define wxVsscanf vsscanf
105 // stdlib not defined in VA V4
106 #if !wxUSE_UNICODE
107 # define wxAtof atof
108 #endif
109 #define wxAtoi atoi
110 #define wxAtol atol
111 #define wxGetenv getenv
112 #define wxSystem system
113 // time.h functions -- none defined in tchar.h
114 #define wxAsctime asctime
115 #define wxCtime ctime
116 #endif // compilers with (good) TCHAR support
117
118 #ifdef wxHAVE_TCHAR_FUNCTIONS
119 # define HAVE_WCSLEN 1
120
121 # include <tchar.h>
122
123 # if wxUSE_UNICODE // temporary - preserve binary compatibility
124 #if defined(__GNUWIN32__)
125 #define _TCHAR TCHAR
126 #define _TSCHAR TCHAR
127 #define _TUCHAR TCHAR
128 #endif
129
130 typedef _TCHAR wxChar;
131 typedef _TSCHAR wxSChar;
132 typedef _TUCHAR wxUChar;
133 # else
134 # define wxChar char
135 # define wxSChar signed char
136 # define wxUChar unsigned char
137 # endif
138
139 // wchar_t is available
140 #ifndef wxUSE_WCHAR_T
141 #define wxUSE_WCHAR_T 1
142 #endif // !defined(wxUSE_WCHAR_T)
143
144 // ctype.h functions
145 #ifndef wxNO_TCHAR_CTYPE
146 #ifdef __BORLANDC__
147 # include <ctype.h>
148 #endif
149 # define wxIsalnum _istalnum
150 # define wxIsalpha _istalpha
151 # define wxIsctrl _istctrl
152 # define wxIsdigit _istdigit
153 # define wxIsgraph _istgraph
154 # define wxIslower _istlower
155 # define wxIsprint _istprint
156 # define wxIspunct _istpunct
157 # define wxIsspace _istspace
158 # define wxIsupper _istupper
159 # define wxIsxdigit _istxdigit
160 # define wxTolower _totlower
161 # define wxToupper _totupper
162 #endif // wxNO_TCHAR_CTYPE
163
164 // locale.h functons
165 #ifndef wxNO_TCHAR_LOCALE
166 # define wxSetlocale _tsetlocale
167 #endif // wxNO_TCHAR_LOCALE
168
169 // string.h functions
170 #ifndef wxNO_TCHAR_STRING
171 # define wxStrcat _tcscat
172 # define wxStrchr _tcschr
173 # define wxStrcmp _tcscmp
174 # define wxStrcoll _tcscoll
175 # define wxStrcpy _tcscpy
176 # define wxStrcspn _tcscspn
177 # define wxStrftime _tcsftime
178 # define wxStricmp _tcsicmp
179 # define wxStrlen_ _tcslen // used in wxStrlen inline function
180 # define wxStrncat _tcsncat
181 # define wxStrncmp _tcsncmp
182 # define wxStrncpy _tcsncpy
183 # define wxStrpbrk _tcspbrk
184 # define wxStrrchr _tcsrchr
185 # define wxStrspn _tcsspn
186 # define wxStrstr _tcsstr
187 # define wxStrtod _tcstod
188 # define wxStrtol _tcstol
189 # define wxStrtoul _tcstoul
190 # define wxStrxfrm _tcsxfrm
191 #endif // wxNO_TCHAR_STRING
192
193 // stdio.h functions
194 #ifndef wxNO_TCHAR_STDIO
195 # define wxFgetc _fgettc
196 # define wxFgetchar _fgettchar
197 # define wxFgets _fgetts
198 # define wxFopen _tfopen
199 # define wxFputc _fputtc
200 # define wxFputchar _fputtchar
201 # define wxFprintf _ftprintf
202 # define wxFreopen _tfreopen
203 # define wxFscanf _ftscanf
204 # define wxGetc _gettc
205 # define wxGetchar _gettchar
206 # define wxGets _getts
207 # define wxPerror _tperror
208 # define wxPrintf _tprintf
209 # define wxPutc _puttc
210 # define wxPutchar _puttchar
211 # define wxPuts _putts
212 # define wxRemove _tremove
213 # define wxRename _trename
214 # define wxScanf _tscanf
215 # define wxSprintf _stprintf
216 # define wxSscanf _stscanf
217 # define wxTmpnam _ttmpnam
218 # define wxUngetc _tungetc
219 # define wxVfprint _vftprintf
220 # define wxVprintf _vtprintf
221 # define wxVsscanf _vstscanf
222 # define wxVsprintf _vstprintf
223 #elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
224 // it has some stdio.h functions, apparently
225 # define wxFgetc _fgettc
226 # define wxFgets _fgetts
227 # define wxFputc _fputtc
228 # define wxFprintf _ftprintf
229 # define wxFscanf _ftscanf
230 # define wxGetc _gettc
231 # define wxGetchar _gettchar
232 # define wxPrintf _tprintf
233 # define wxPutc _puttc
234 # define wxPutchar _puttchar
235 # define wxScanf _tscanf
236 # define wxSprintf _stprintf
237 # define wxSscanf _stscanf
238 # define wxVfprint _vftprintf
239 # define wxVprintf _vtprintf
240 # define wxVsprintf _vstprintf
241 #endif // wxNO_TCHAR_STDIO
242
243 // stdlib.h functions
244 #ifndef wxNO_TCHAR_STDLIB
245 # if !wxUSE_UNICODE
246 # define wxAtof atof
247 # endif
248 # define wxAtoi _ttoi
249 # define wxAtol _ttol
250 # define wxGetenv _tgetenv
251 # define wxSystem _tsystem
252 #endif // wxNO_TCHAR_STDLIB
253
254 // time.h functions
255 #ifndef wxNO_TCHAR_TIME
256 # define wxAsctime _tasctime
257 # define wxCtime _tctime
258 #endif // wxNO_TCHAR_TIME
259
260 #else // !TCHAR-aware compilers
261
262 // check whether we should include wchar.h or equivalent
263 # if !defined(wxUSE_WCHAR_T)
264 # if defined(__VISUALC__) && (__VISUALC__ < 900)
265 # define wxUSE_WCHAR_T 0 // wchar_t is not available for MSVC++ 1.5
266 # elif defined(__UNIX__)
267 # if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__)
268 # define wxUSE_WCHAR_T 1
269 # else
270 # define wxUSE_WCHAR_T 0
271 # endif
272 # elif defined(__GNUWIN32__) && !defined(__MINGW32__) // Cygwin (not Mingw32) doesn't have wcslen.h, needed in buffer.h
273 # define wxUSE_WCHAR_T 0
274 # elif defined(__BORLANDC__) // WIN16 BC++
275 # define wxUSE_WCHAR_T 0
276 # elif defined(__WATCOMC__)
277 # define wxUSE_WCHAR_T 0
278 # elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
279 # define wxUSE_WCHAR_T 1
280 # else
281 // add additional compiler checks if this fails
282 # define wxUSE_WCHAR_T 1
283 # endif
284 # endif // !defined(wxUSE_WCHAR_T)
285
286 # if wxUSE_WCHAR_T
287 # ifdef HAVE_WCSTR_H
288 # include <wcstr.h>
289 # else
290 # ifndef __FreeBSD__
291 # include <wchar.h>
292 # else
293 # include <stdlib.h>
294 # define wxNEED_WCSLEN
295 # endif
296 # endif
297 # endif
298
299 // check whether we are doing Unicode
300 # if wxUSE_UNICODE
301
302 # include <wctype.h>
303
304 // this is probably glibc-specific
305 # if defined(__WCHAR_TYPE__)
306
307 typedef __WCHAR_TYPE__ wxChar;
308 typedef signed __WCHAR_TYPE__ wxSChar;
309 typedef unsigned __WCHAR_TYPE__ wxUChar;
310
311 # define _T(x) L##x
312
313 // ctype.h functions (wctype.h)
314 # define wxIsalnum iswalnum
315 # define wxIsalpha iswalpha
316 # define wxIsctrl iswcntrl
317 # define wxIsdigit iswdigit
318 # define wxIsgraph iswgraph
319 # define wxIslower iswlower
320 # define wxIsprint iswprint
321 # define wxIspunct iswpunct
322 # define wxIsspace iswspace
323 # define wxIsupper iswupper
324 # define wxIsxdigit iswxdigit
325
326 # if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
327 // /usr/include/wctype.h incorrectly declares translations tables which
328 // provokes tons of compile-time warnings - try to correct this
329 # define wxTolower(wc) towctrans((wc), (wctrans_t)__ctype_tolower)
330 # define wxToupper(wc) towctrans((wc), (wctrans_t)__ctype_toupper)
331 # else
332 # define wxTolower towlower
333 # define wxToupper towupper
334 # endif // gcc/!gcc
335
336 // string.h functions (wchar.h)
337 # define wxStrcat wcscat
338 # define wxStrchr wcschr
339 # define wxStrcmp wcscmp
340 # define wxStrcoll wcscoll
341 # define wxStrcpy wcscpy
342 # define wxStrcspn wcscspn
343 # define wxStrlen_ wcslen // used in wxStrlen inline function
344 # define wxStrncat wcsncat
345 # define wxStrncmp wcsncmp
346 # define wxStrncpy wcsncpy
347 # define wxStrpbrk wcspbrk
348 # define wxStrrchr wcsrchr
349 # define wxStrspn wcsspn
350 # define wxStrstr wcsstr
351 # define wxStrtod wcstod
352 # define wxStrtok wcstok
353 # define wxStrtol wcstol
354 # define wxStrtoul wcstoul
355 # define wxStrxfrm wcsxfrm
356
357 // glibc doesn't have wc equivalents of the other stuff
358 # define wxNEED_WX_STDIO_H
359 # define wxNEED_WX_STDLIB_H
360 # define wxNEED_WX_TIME_H
361
362 # else//!glibc
363 # error "Please define your compiler's Unicode conventions in wxChar.h"
364 # endif
365 # else//!Unicode
366
367 # include <ctype.h>
368 # include <string.h>
369
370 # if 0 // temporary - preserve binary compatibilty
371 typedef char wxChar;
372 typedef signed char wxSChar;
373 typedef unsigned char wxUChar;
374 # else
375 # define wxChar char
376 # define wxSChar signed char
377 # define wxUChar unsigned char
378 # endif
379
380 # if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__UNIX__))
381 # undef _T
382 # endif
383
384 # if !defined(__MINGW32__) || !defined(_T)
385 # define _T(x) x
386 # endif
387
388 // ctype.h functions
389 # define wxIsalnum isalnum
390 # define wxIsalpha isalpha
391 # define wxIsctrl isctrl
392 # define wxIsdigit isdigit
393 # define wxIsgraph isgraph
394 # define wxIslower islower
395 # define wxIsprint isprint
396 # define wxIspunct ispunct
397 # define wxIsspace isspace
398 # define wxIsupper isupper
399 # define wxIsxdigit isxdigit
400 # define wxTolower tolower
401 # define wxToupper toupper
402
403 // locale.h functons
404 # define wxSetlocale setlocale
405
406 // string.h functions
407 // #define wxStricmp strcasecmp
408 // wxStricmp is defined below!!
409
410 #ifdef HAVE_STRTOK_R
411 #define wxStrtok(str, sep, last) strtok_r(str, sep, last)
412 #else
413 #define wxStrtok(str, sep, last) strtok(str, sep)
414 #endif
415
416 // leave the rest to defaults below
417 # define wxNEED_WX_STRING_H
418 # define wxNEED_WX_STDIO_H
419 # define wxNEED_WX_STDLIB_H
420 # define wxNEED_WX_TIME_H
421
422 # endif//Unicode
423 #endif//TCHAR-aware compilers
424
425 // define wxStricmp for various compilers without Unicode possibilities
426 #if !defined(wxStricmp) && !wxUSE_UNICODE
427 # if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__)
428 # define wxStricmp stricmp
429 # define wxStrnicmp strnicmp
430 # elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__))
431 # define wxStricmp _stricmp
432 # define wxStrnicmp _strnicmp
433 # elif defined(__UNIX__) || defined(__GNUWIN32__)
434 # define wxStricmp strcasecmp
435 # define wxStrnicmp strncasecmp
436 # elif defined(__MWERKS__) && !defined(__INTEL__)
437 // use wxWindows' implementation
438 # else
439 // if you leave wxStricmp undefined, wxWindows' implementation will be used
440 # error "Please define string case-insensitive compare for your OS/compiler"
441 # endif
442 #endif
443
444 // if we need to define for standard headers, and we're not using Unicode,
445 // just define to standard C library routines
446 #if !wxUSE_UNICODE
447 # ifdef wxNEED_WX_STRING_H
448 # define wxStrcat strcat
449 # define wxStrchr strchr
450 # define wxStrcmp strcmp
451 # define wxStrcoll strcoll
452 # define wxStrcpy strcpy
453 # define wxStrcspn strcspn
454 # define wxStrdup strdup
455 # define wxStrlen_ strlen // used in wxStrlen inline function
456 # define wxStrncat strncat
457 # define wxStrncmp strncmp
458 # define wxStrncpy strncpy
459 # define wxStrpbrk strpbrk
460 # define wxStrrchr strrchr
461 # define wxStrspn strspn
462 # define wxStrstr strstr
463 # define wxStrtod strtod
464 # define wxStrtol strtol
465 # define wxStrtoul strtoul
466 # define wxStrxfrm strxfrm
467 # undef wxNEED_WX_STRING_H
468 # endif
469
470 # ifdef wxNEED_WX_STDIO_H
471 # define wxFgetc fgetc
472 # define wxFgetchar fgetchar
473 # define wxFgets fgets
474 # define wxFopen fopen
475 # define wxFputc fputc
476 # define wxFputchar fputchar
477 # define wxFprintf fprintf
478 # define wxFreopen freopen
479 # define wxFscanf fscanf
480 # define wxGetc getc
481 # define wxGetchar getchar
482 # define wxGets gets
483 # define wxPerror perror
484 # define wxPrintf printf
485 # define wxPutc putc
486 # define wxPutchar putchar
487 # define wxPuts puts
488 # define wxRemove remove
489 # define wxRename rename
490 # define wxScanf scanf
491 # define wxSprintf sprintf
492 # define wxSscanf sscanf
493 # define wxTmpnam tmpnam
494 # define wxUngetc ungetc
495 # define wxVfprint vfprintf
496 # define wxVprintf vprintf
497 # define wxVsscanf vsscanf
498 # define wxVsprintf vsprintf
499 # undef wxNEED_WX_STDIO_H
500 # endif
501
502 # ifdef wxNEED_WX_STDLIB_H
503 # define wxAtof atof
504 # define wxAtoi atoi
505 # define wxAtol atol
506 # define wxGetenv getenv
507 # define wxSystem system
508 # undef wxNEED_WX_STDLIB_H
509 # endif
510
511 # ifdef wxNEED_WX_TIME_H
512 # define wxAsctime asctime
513 # define wxCtime ctime
514 # define wxStrftime strftime
515 # undef wxNEED_WX_TIME_H
516 # endif
517 #endif //!Unicode
518
519 #if defined(wxNEED_WCSLEN) && wxUSE_UNICODE
520 # define wcslen wxStrlen
521 # undef wxNEED_WCSLEN
522 #endif
523
524 // checks whether the passed in pointer is NULL and if the string is empty
525 inline bool wxIsEmpty(const wxChar *p) { return !p || !*p; }
526
527 #ifndef wxNEED_WX_STRING_H
528 // safe version of strlen() (returns 0 if passed NULL pointer)
529 inline size_t wxStrlen(const wxChar *psz)
530 { return psz ? wxStrlen_(psz) : 0; }
531 #endif
532
533 #if wxUSE_WCHAR_T
534 // multibyte<->widechar conversion
535 WXDLLEXPORT size_t wxMB2WC(wchar_t *buf, const char *psz, size_t n);
536 WXDLLEXPORT size_t wxWC2MB(char *buf, const wchar_t *psz, size_t n);
537 # if wxUSE_UNICODE
538 # define wxMB2WX wxMB2WC
539 # define wxWX2MB wxWC2MB
540 # define wxWC2WX wxStrncpy
541 # define wxWX2WC wxStrncpy
542 # else
543 # define wxMB2WX wxStrncpy
544 # define wxWX2MB wxStrncpy
545 # define wxWC2WX wxWC2MB
546 # define wxWX2WC wxMB2WC
547 # endif
548 #else
549 // No wxUSE_WCHAR_T: we have to do something (JACS)
550 # define wxMB2WC wxStrncpy
551 # define wxWC2MB wxStrncpy
552 # define wxMB2WX wxStrncpy
553 # define wxWX2MB wxStrncpy
554 # define wxWC2WX wxWC2MB
555 # define wxWX2WC wxMB2WC
556 #endif
557
558 WXDLLEXPORT bool wxOKlibc(); // for internal use
559
560 // if libc versions are not available, use replacements defined in wxchar.cpp
561 #ifndef wxStrdup
562 WXDLLEXPORT wxChar * wxStrdup(const wxChar *psz);
563 #endif
564
565 #ifndef wxStricmp
566 WXDLLEXPORT int wxStricmp(const wxChar *psz1, const wxChar *psz2);
567 #endif
568
569 #ifndef wxStrtok
570 WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr);
571 #endif
572
573 #ifndef wxSetlocale
574 class wxWCharBuffer;
575 WXDLLEXPORT wxWCharBuffer wxSetlocale(int category, const wxChar *locale);
576 #endif
577
578 #ifdef wxNEED_WCSLEN // for use in buffer.h
579 WXDLLEXPORT size_t wcslen(const wchar_t *s);
580 #endif
581
582 #ifdef wxNEED_WX_CTYPE_H
583 WXDLLEXPORT int wxIsalnum(wxChar ch);
584 WXDLLEXPORT int wxIsalpha(wxChar ch);
585 WXDLLEXPORT int wxIsctrl(wxChar ch);
586 WXDLLEXPORT int wxIsdigit(wxChar ch);
587 WXDLLEXPORT int wxIsgraph(wxChar ch);
588 WXDLLEXPORT int wxIslower(wxChar ch);
589 WXDLLEXPORT int wxIsprint(wxChar ch);
590 WXDLLEXPORT int wxIspunct(wxChar ch);
591 WXDLLEXPORT int wxIsspace(wxChar ch);
592 WXDLLEXPORT int wxIsupper(wxChar ch);
593 WXDLLEXPORT int wxIsxdigit(wxChar ch);
594 WXDLLEXPORT int wxTolower(wxChar ch);
595 WXDLLEXPORT int wxToupper(wxChar ch);
596 #endif
597
598 #ifdef wxNEED_WX_STRING_H
599 WXDLLEXPORT wxChar * wxStrcat(wxChar *dest, const wxChar *src);
600 WXDLLEXPORT wxChar * wxStrchr(const wxChar *s, wxChar c);
601 WXDLLEXPORT int wxStrcmp(const wxChar *s1, const wxChar *s2);
602 WXDLLEXPORT int wxStrcoll(const wxChar *s1, const wxChar *s2);
603 WXDLLEXPORT wxChar * wxStrcpy(wxChar *dest, const wxChar *src);
604 WXDLLEXPORT size_t wxStrcspn(const wxChar *s, const wxChar *reject);
605 WXDLLEXPORT size_t wxStrlen(const wxChar *s);
606 WXDLLEXPORT wxChar * wxStrncat(wxChar *dest, const wxChar *src, size_t n);
607 WXDLLEXPORT int wxStrncmp(const wxChar *s1, const wxChar *s2, size_t n);
608 WXDLLEXPORT wxChar * wxStrncpy(wxChar *dest, const wxChar *src, size_t n);
609 WXDLLEXPORT wxChar * wxStrpbrk(const wxChar *s, const wxChar *accept);
610 WXDLLEXPORT wxChar * wxStrrchr(const wxChar *s, wxChar c);
611 WXDLLEXPORT size_t wxStrspn(const wxChar *s, const wxChar *accept);
612 WXDLLEXPORT wxChar * wxStrstr(const wxChar *haystack, const wxChar *needle);
613 WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr);
614 WXDLLEXPORT long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base);
615 WXDLLEXPORT unsigned long int wxStrtoul(const wxChar *nptr, wxChar **endptr, int base);
616 WXDLLEXPORT size_t wxStrxfrm(wxChar *dest, const wxChar *src, size_t n);
617 #endif
618
619 #ifdef wxNEED_WX_STDIO_H
620 # include <stdio.h>
621 # include <stdarg.h>
622 WXDLLEXPORT FILE * wxFopen(const wxChar *path, const wxChar *mode);
623 WXDLLEXPORT FILE * wxFreopen(const wxChar *path, const wxChar *mode, FILE *stream);
624 WXDLLEXPORT int wxRemove(const wxChar *path);
625 WXDLLEXPORT int wxRename(const wxChar *oldpath, const wxChar *newpath);
626 WXDLLEXPORT int wxPrintf(const wxChar *fmt, ...);
627 WXDLLEXPORT int wxVprintf(const wxChar *fmt, va_list argptr);
628 WXDLLEXPORT int wxFprintf(FILE *stream, const wxChar *fmt, ...);
629 WXDLLEXPORT int wxVfprintf(FILE *stream, const wxChar *fmt, va_list argptr);
630 WXDLLEXPORT int wxSprintf(wxChar *buf, const wxChar *fmt, ...);
631 WXDLLEXPORT int wxVsprintf(wxChar *buf, const wxChar *fmt, va_list argptr);
632 WXDLLEXPORT int wxSscanf(const wxChar *buf, const wxChar *fmt, ...);
633 WXDLLEXPORT int wxVsscanf(const wxChar *buf, const wxChar *fmt, va_list argptr);
634 #endif
635
636 #ifndef wxAtof
637 WXDLLEXPORT double wxAtof(const wxChar *psz);
638 #endif
639
640 #ifdef wxNEED_WX_STDLIB_H
641 WXDLLEXPORT int wxAtoi(const wxChar *psz);
642 WXDLLEXPORT long wxAtol(const wxChar *psz);
643 WXDLLEXPORT wxChar * wxGetenv(const wxChar *name);
644 WXDLLEXPORT int wxSystem(const wxChar *psz);
645 #endif
646
647 #ifdef wxNEED_WX_TIME_H
648 WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm);
649 #endif
650
651 // under VC++ 6.0 isspace() returns 1 for 8 bit chars which completely breaks
652 // the file parsing - this may be true for 5.0 as well, update #ifdef then
653 #if defined(__VISUALC__) && (__VISUALC__ >= 1200) && !wxUSE_UNICODE
654 #undef wxIsspace
655 #define wxIsspace(c) ((((unsigned)c) < 128) && isspace(c))
656 #endif // VC++
657
658 // ----------------------------------------------------------------------------
659 // common macros which are always defined
660 // ----------------------------------------------------------------------------
661
662 // although global macros with such names are really bad, we want to have
663 // another name for _T() which should be used to avoid confusion between _T()
664 // and _() in wxWindows sources
665 #define wxT(x) _T(x)
666
667 // a Unicode-friendly __FILE__ analog
668 #ifndef __TFILE__
669 #define __XFILE__(x) wxT(x)
670 #define __TFILE__ __XFILE__(__FILE__)
671 #endif
672
673 #endif
674 //_WX_WXCHAR_H_
675