1 2 /* $Id$ */ 3 4 #ifndef __TCHAR_LOCAL_H 5 #define __TCHAR_LOCAL_H 6 7 8 /* Unicode support */ 9 #ifdef _WIN32 10 11 # include <windows.h> 12 # include <wchar.h> 13 # include <tchar.h> 14 15 /* The PRINTF_S character is used in situations where we have a string 16 with one TCHAR and one char argument. It's impossible to use the 17 _TEXT macro because we don't know which will be which. */ 18 #define PRINTF_S "S" 19 20 #define _tmemmove wmemmove 21 22 /* The Win32 API does have lstat, just stat. As such, we don't have to 23 worry about the difference between the two. */ 24 #define _lstat _tstat 25 #define _sstat _tstat 26 #define _tstat_t struct _stat 27 28 29 30 #else // ifdef _WIN32 31 32 33 #define PRINTF_S "s" 34 35 /* The next few paragraphs are similar to tchar.h when UNICODE 36 is not defined. They define all of the _t* functions to use 37 the standard char * functions. This works just fine on Linux and OS X */ 38 #define TCHAR char 39 40 #define _TDIR DIR 41 #define _TEXT(A) A 42 43 #define _sntprintf snprintf 44 #define _tprintf printf 45 #define _ftprintf fprintf 46 47 #define _lstat lstat 48 #define _sstat stat 49 #define _tstat_t struct stat 50 51 #define _tgetcwd getcwd 52 #define _tfopen fopen 53 #define _fgetts fgets 54 55 #define _topendir opendir 56 #define _treaddir readdir 57 #define _tdirent dirent 58 #define _tclosedir closedir 59 60 #define _tcsncpy strncpy 61 #define _tcslen strlen 62 #define _tcsnicmp strncasecmp 63 #define _tcsncmp strncmp 64 #define _tcsrchr strrchr 65 #define _tmemmove memmove 66 #define _tcsdup strdup 67 #define _tcsstr strstr 68 69 #endif 70 71 72 #endif // __TCHAR_LOCAL_H 73