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