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