orx  1.14
Portable Game Engine
orxType.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2022 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
42 #ifndef _orxTYPE_H_
43 #define _orxTYPE_H_
44 
45 /* *** Uses orx declarations *** */
46 #include "base/orxDecl.h"
47 
48 /* *** Platform dependent base types */
49 
50 /* Windows */
51 #ifdef __orxWINDOWS__
52 
53  #ifdef __orxX86_64__
54 
55  typedef unsigned int orxU32;
56  typedef unsigned short orxU16;
57  typedef unsigned char orxU8;
58 
59  typedef signed int orxS32;
60  typedef signed short orxS16;
61  typedef signed char orxS8;
62 
63  typedef unsigned int orxBOOL;
64 
65  #else /* __orxX86_64__ */
66 
67  typedef unsigned long orxU32;
68  typedef unsigned short orxU16;
69  typedef unsigned char orxU8;
70 
71  typedef signed long orxS32;
72  typedef signed short orxS16;
73  typedef signed char orxS8;
74 
75  typedef unsigned long orxBOOL;
76 
77  #endif /* __orxX86_64__ */
78 
79  /* Compiler specific */
80  #ifdef __orxGCC__
81 
82  typedef unsigned long long orxU64;
83  typedef signed long long orxS64;
84 
85  #endif /* __orxGCC__ */
86  #ifdef __orxLLVM__
87 
88  typedef unsigned long long orxU64;
89  typedef signed long long orxS64;
90 
91  #endif /* __orxLLVM__ */
92  #ifdef __orxMSVC__
93 
94  typedef unsigned __int64 orxU64;
95  typedef signed __int64 orxS64;
96 
97  #endif /* __orxMSVC__ */
98 
99  typedef float orxFLOAT;
100  typedef double orxDOUBLE;
101 
102  typedef char orxCHAR;
103  #define orxSTRING orxCHAR *
104  typedef orxU64 orxSTRINGID;
105 
106  typedef orxU32 orxENUM;
107 
108  #define orx2F(V) ((orxFLOAT)(V))
109  #define orx2D(V) ((orxDOUBLE)(V))
110 
111  #define orxENUM_NONE 0xFFFFFFFF
112 
113 #else /* __orxWINDOWS__ */
114 
115  /* Linux / Mac / iOS / Android */
116  #if defined(__orxLINUX__) || defined(__orxMAC__) || defined(__orxIOS__) || defined(__orxANDROID__)
117 
118  #ifdef __orx64__
119 
120  typedef unsigned long long orxU64;
121  typedef unsigned int orxU32;
122  typedef unsigned short orxU16;
123  typedef unsigned char orxU8;
124 
125  typedef signed long long orxS64;
126  typedef signed int orxS32;
127  typedef signed short orxS16;
128  typedef signed char orxS8;
129 
130  typedef unsigned int orxBOOL;
131 
132  #else /* __orx64__ */
133 
134  typedef unsigned long long orxU64;
135  typedef unsigned long orxU32;
136  typedef unsigned short orxU16;
137  typedef unsigned char orxU8;
138 
139  typedef signed long long orxS64;
140  typedef signed long orxS32;
141  typedef signed short orxS16;
142  typedef signed char orxS8;
143 
144  typedef unsigned long orxBOOL;
145 
146  #endif /* __orx64__ */
147 
148  typedef float orxFLOAT;
149  typedef double orxDOUBLE;
150 
151  typedef char orxCHAR;
152  #define orxSTRING orxCHAR *
153  typedef orxU64 orxSTRINGID;
154 
155  typedef orxU32 orxENUM;
156 
157  #define orx2F(V) ((orxFLOAT)(V))
158  #define orx2D(V) ((orxDOUBLE)(V))
159 
160  #define orxENUM_NONE 0xFFFFFFFF
161 
162  #endif /* __orxLINUX__ || __orxMAC__ || __orxIOS__ || __orxANDROID__ */
163 
164 #endif /* __orxWINDOWS__ */
165 
166 typedef void * orxHANDLE;
167 
168 #if defined(__orx64__)
169 
170  typedef orxS64 orxSPTR;
171  typedef orxU64 orxUPTR;
172 
173 #elif defined(__orx32__)
174 
175  typedef orxS32 orxSPTR;
176  typedef orxU32 orxUPTR;
177 
178 #endif
179 
180 /* *** Misc constants *** */
181 
182 /* *** Seek offset constants *** */
183 typedef enum __orxSEEK_OFFSET_WHENCE_t
184 {
188 
190 
192 
194 
195 
196 /* *** Boolean constants *** */
197 #define orxFALSE ((orxBOOL)(1 != 1))
198 #define orxTRUE ((orxBOOL)(1 == 1))
199 
200 
201 /* *** Float constants *** */
202 static const orxFLOAT orxFLOAT_0 = orx2F(0.0f);
203 static const orxFLOAT orxFLOAT_1 = orx2F(1.0f);
204 static const orxFLOAT orxFLOAT_MAX = orx2F(3.402823466e+38f);
205 
206 /* *** Double constants *** */
207 static const orxDOUBLE orxDOUBLE_0 = orx2D(0.0);
208 static const orxDOUBLE orxDOUBLE_1 = orx2D(1.0);
209 static const orxDOUBLE orxDOUBLE_MAX = orx2D(1.7976931348623158e+308);
210 
211 
212 /* *** Undefined constants *** */
213 static const orxU64 orxU64_UNDEFINED = (orxU64)(-1);
214 static const orxU32 orxU32_UNDEFINED = (orxU32)(-1);
215 static const orxU16 orxU16_UNDEFINED = (orxU16)(-1);
216 static const orxU8 orxU8_UNDEFINED = (orxU8)(-1);
218 static const orxSTRINGID orxSTRINGID_UNDEFINED = (orxSTRINGID)(-1);
219 
220 
221 /* *** String & character constants *** */
222 extern orxDLLAPI const orxSTRING orxSTRING_EMPTY;
223 extern orxDLLAPI const orxSTRING orxSTRING_TRUE;
224 extern orxDLLAPI const orxSTRING orxSTRING_FALSE;
225 extern orxDLLAPI const orxSTRING orxSTRING_EOL;
226 
227 #define orxCHAR_NULL '\0'
228 #define orxCHAR_CR '\r'
229 #define orxCHAR_LF '\n'
230 #define orxCHAR_EOL '\n'
231 #define orxCHAR_ASCII_NUMBER 128
232 
233 #define _orxSTRINGIFY(X) #X
234 #define orxSTRINGIFY(X) _orxSTRINGIFY(X)
235 
236 
237 /* *** Directory separators *** */
238 
239 extern orxDLLAPI const orxSTRING orxSTRING_DIRECTORY_SEPARATOR;
240 
241 #define orxCHAR_DIRECTORY_SEPARATOR_WINDOWS '\\'
242 #define orxCHAR_DIRECTORY_SEPARATOR_LINUX '/'
243 
244 #ifdef __orxWINDOWS__
245 
246 #define orxCHAR_DIRECTORY_SEPARATOR '\\'
247 
248 #else /* __orxWINDOWS__ */
249 
250 #define orxCHAR_DIRECTORY_SEPARATOR '/'
251 
252 #endif /* __orxWINDOWS__ */
253 
254 
255 /* *** Status defines *** */
256 typedef enum __orxSTATUS_t
257 {
263  orxSTATUS_NONE = orxENUM_NONE
265 } orxSTATUS;
266 
267 #endif /*_orxTYPE_H_*/
268 
static const orxSTRINGID orxSTRINGID_UNDEFINED
Definition: orxType.h:218
static const orxDOUBLE orxDOUBLE_MAX
Definition: orxType.h:209
orxDLLAPI const orxSTRING orxSTRING_DIRECTORY_SEPARATOR
static const orxDOUBLE orxDOUBLE_0
Definition: orxType.h:207
static const orxFLOAT orxFLOAT_1
Definition: orxType.h:203
static const orxU32 orxU32_UNDEFINED
Definition: orxType.h:214
orxDLLAPI const orxSTRING orxSTRING_EMPTY
void * orxHANDLE
Definition: orxType.h:166
orxDLLAPI const orxSTRING orxSTRING_TRUE
orxSTATUS
Definition: orxType.h:256
static const orxU64 orxU64_UNDEFINED
Definition: orxType.h:213
static const orxDOUBLE orxDOUBLE_1
Definition: orxType.h:208
orxSEEK_OFFSET_WHENCE
Definition: orxType.h:183
#define orxDLLAPI
Definition: orxDecl.h:370
static const orxFLOAT orxFLOAT_0
Definition: orxType.h:202
static const orxU16 orxU16_UNDEFINED
Definition: orxType.h:215
orxDLLAPI const orxSTRING orxSTRING_FALSE
static const orxFLOAT orxFLOAT_MAX
Definition: orxType.h:204
orxDLLAPI const orxSTRING orxSTRING_EOL
static const orxHANDLE orxHANDLE_UNDEFINED
Definition: orxType.h:217
static const orxU8 orxU8_UNDEFINED
Definition: orxType.h:216

Generated for orx by doxygen 1.8.11