forked from sabrogden/Ditto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnicodeMacros.h
86 lines (71 loc) · 1.32 KB
/
UnicodeMacros.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#pragma once
#ifdef _UNICODE
#define STRLEN(pText) wcslen(pText)
#else
#define STRLEN(pText) strlen(pText)
#endif
#ifdef _UNICODE
#define STRSTR(a, b) wcsstr(a, b)
#else
#define STRSTR(a, b) strstr(a, b)
#endif
#ifdef _UNICODE
#define STRCMP(a, b) wcscmp(a, b)
#else
#define STRCMP(a, b) strcmp(a, b)
#endif
#ifdef _UNICODE
#define STRTOK(a, b) wcstok(a, b)
#else
#define STRTOK(a, b) strtok(a, b)
#endif
#ifdef _UNICODE
#define STRCPY(a, b) wcscpy(a, b)
#else
#define STRCPY(a, b) strcpy(a, b)
#endif
#ifdef _UNICODE
#define STRNCPY(a, b, l) wcsncpy(a, b, l)
#else
#define STRNCPY(a, b, l) strncpy(a, b, l)
#endif
#ifdef _UNICODE
#define SPRINTF wsprintf
#else
#define SPRINTF sprintf
#endif
#ifdef _UNICODE
#define STRNCPY(a, b, t) wcsncpy(a, b, t)
#else
#define STRNCPY(a, b, t) strncpy(a, b, t)
#endif
#ifdef _UNICODE
#define ATOL(a) _wtol(a)
#else
#define ATOL(a) atol(a)
#endif
#ifdef _UNICODE
#define ATOI(a) _wtoi(a)
#else
#define ATOI(a) atoi(a)
#endif
#ifdef _UNICODE
#define SPLITPATH _wsplitpath
#else
#define SPLITPATH _splitpath
#endif
#ifdef _UNICODE
#define STAT _wstat
#else
#define STAT _stat
#endif
#ifdef _UNICODE
#define STRICMP _wcsicmp
#else
#define STRICMP _stricmp
#endif
#ifdef _UNICODE
#define GETENV _wgetenv
#else
#define GETENV getenv
#endif