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