-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlatDef.h
105 lines (92 loc) · 2.01 KB
/
PlatDef.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* PLATDEF.H - Platform specific types. Portability header.
* Copyright (C) 2001 Rob Fahrni. All rights reserved.
*
*/
#ifndef _PLATDEF_H
#define _PLATDEF_H
#if defined(WIN32)
#include <windows.h> // Windows API defs.
#include <tchar.h>
// Portable types.
//
#define String LPTSTR
#define ConstString LPCTSTR
#define Char TCHAR
#define Int int
#define UInt unsigned int
#define Long long
#define Boolean bool // We're assuming C++ here!
#define DWord DWORD
#define Void void
#define True true
#define False false
// Library defines.
//
#define StrCpy _tcscpy
#define StrNCpy _tcsncpy
#define StrCat _tcscat
#define StrLen _tcslen
#define StrStr _tcsstr
#define Sprintf _stprintf
#define SprintfN _sntprintf
#define Memset memset
#define ItoA _itoa
#define AtoL atol
// Defines for string sizes.
//
#define BIG_BUFFER 256
#define MONSTER_BUFFER 2048
#elif defined(MAC)
// Do Mac portable types here.
//
// Portable types.
//
typedef String char*;
typedef Char char;
typedef Int int;
#define UInt unsigned int
typedef Long long;
typedef Boolean bool; // We're assuming C++ here!
#define True true
#define False false
// Library defines.
//
#define StrCpy strcpy
#define StrNCpy strncpy
#define StrCat strcat
#define StrLen strlen
#define Sprintf sprintf
#define SprintfN snprintf
#define Memset memset
#define IN
#define OUT
#elif defined(LINUX)
// Do Linux/Unix types here.
//
// Portable types.
//
typedef String char*;
typedef Char char;
typedef Int int;
#define UInt unsigned int
typedef Long long;
typedef Boolean bool; // We're assuming C++ here!
#define True true
#define False false
// Library defines.
//
#define StrCpy strcpy
#define StrNCpy strncpy
#define StrCat strcat
#define StrLen strlen
#define Sprintf sprintf
#define SprintfN snprintf
#define Memset memset
#define IN
#define OUT
#else
// Specify platform before building.
//
#error No platform specified, see PlatDef.h for platforms.
#endif
#endif // _PLATDEF_H