orx  1.10
Portable Game Engine
orxType.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2019 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  typedef void * orxHANDLE;
54 
55  #ifdef __orxX86_64__
56 
57  typedef unsigned int orxU32;
58  typedef unsigned short orxU16;
59  typedef unsigned char orxU8;
60 
61  typedef signed int orxS32;
62  typedef signed short orxS16;
63  typedef signed char orxS8;
64 
65  typedef unsigned int orxBOOL;
66 
67  #else /* __orxX86_64__ */
68 
69  typedef unsigned long orxU32;
70  typedef unsigned short orxU16;
71  typedef unsigned char orxU8;
72 
73  typedef signed long orxS32;
74  typedef signed short orxS16;
75  typedef signed char orxS8;
76 
77  typedef unsigned long orxBOOL;
78 
79  #endif /* __orxX86_64__ */
80 
81  typedef float orxFLOAT;
82  typedef double orxDOUBLE;
83 
84  typedef char orxCHAR;
85  #define orxSTRING orxCHAR *
86  typedef orxU32 orxSTRINGID;
87 
88  typedef orxU32 orxENUM;
89 
90  #define orx2F(V) ((orxFLOAT)(V))
91  #define orx2D(V) ((orxDOUBLE)(V))
92 
93  #define orxENUM_NONE 0xFFFFFFFF
94 
95  /* Compiler specific */
96  #ifdef __orxGCC__
97 
98  typedef unsigned long long orxU64;
99  typedef signed long long orxS64;
100 
101  #endif /* __orxGCC__ */
102  #ifdef __orxLLVM__
103 
104  typedef unsigned long long orxU64;
105  typedef signed long long orxS64;
106 
107  #endif /* __orxLLVM__ */
108  #ifdef __orxMSVC__
109 
110  typedef unsigned __int64 orxU64;
111  typedef signed __int64 orxS64;
112 
113  #endif /* __orxMSVC__ */
114 
115 #else /* __orxWINDOWS__ */
116 
117  /* Linux / Mac / iOS / Android */
118  #if defined(__orxLINUX__) || defined(__orxMAC__) || defined(__orxIOS__) || defined(__orxANDROID__) || defined(__orxANDROID_NATIVE__)
119 
120  typedef void * orxHANDLE;
121 
122  #ifdef __orx64__
123 
124  typedef unsigned long long orxU64;
125  typedef unsigned int orxU32;
126  typedef unsigned short orxU16;
127  typedef unsigned char orxU8;
128 
129  typedef signed long long orxS64;
130  typedef signed int orxS32;
131  typedef signed short orxS16;
132  typedef signed char orxS8;
133 
134  typedef unsigned int orxBOOL;
135 
136  #else /* __orx64__ */
137 
138  typedef unsigned long long orxU64;
139  typedef unsigned long orxU32;
140  typedef unsigned short orxU16;
141  typedef unsigned char orxU8;
142 
143  typedef signed long long orxS64;
144  typedef signed long orxS32;
145  typedef signed short orxS16;
146  typedef signed char orxS8;
147 
148  typedef unsigned long orxBOOL;
149 
150  #endif /* __orx64__ */
151 
152  typedef float orxFLOAT;
153  typedef double orxDOUBLE;
154 
155  typedef char orxCHAR;
156  #define orxSTRING orxCHAR *
157  typedef orxU32 orxSTRINGID;
158 
159  typedef orxU32 orxENUM;
160 
161  #define orx2F(V) ((orxFLOAT)(V))
162  #define orx2D(V) ((orxDOUBLE)(V))
163 
164  #define orxENUM_NONE 0xFFFFFFFF
165 
166  #endif /* __orxLINUX__ || __orxMAC__ || __orxIOS__ || __orxANDROID__ */
167 
168 #endif /* __orxWINDOWS__ */
169 
170 /* *** Misc constants *** */
171 
172 /* *** Seek offset constants *** */
173 typedef enum __orxSEEK_OFFSET_WHENCE_t
174 {
178 
180 
182 
184 
185 
186 /* *** Boolean constants *** */
187 #define orxFALSE ((orxBOOL)(1 != 1))
188 #define orxTRUE ((orxBOOL)(1 == 1))
189 
190 
191 /* *** Float constants *** */
192 static const orxFLOAT orxFLOAT_0 = orx2F(0.0f);
193 static const orxFLOAT orxFLOAT_1 = orx2F(1.0f);
194 static const orxFLOAT orxFLOAT_MAX = orx2F(3.402823466e+38f);
195 
196 /* *** Double constants *** */
197 static const orxDOUBLE orxDOUBLE_0 = orx2D(0.0);
198 static const orxDOUBLE orxDOUBLE_1 = orx2D(1.0);
199 static const orxDOUBLE orxDOUBLE_MAX = orx2D(1.7976931348623158e+308);
200 
201 
202 /* *** Undefined constants *** */
203 static const orxU64 orxU64_UNDEFINED = (orxU64)(-1);
204 static const orxU32 orxU32_UNDEFINED = (orxU32)(-1);
205 static const orxU16 orxU16_UNDEFINED = (orxU16)(-1);
206 static const orxU8 orxU8_UNDEFINED = (orxU8)(-1);
207 static const orxHANDLE orxHANDLE_UNDEFINED = (orxHANDLE)(-1);
208 static const orxSTRINGID orxSTRINGID_UNDEFINED = (orxSTRINGID)(-1);
209 
210 
211 /* *** String & character constants *** */
212 extern orxDLLAPI const orxSTRING orxSTRING_EMPTY;
213 extern orxDLLAPI const orxSTRING orxSTRING_TRUE;
214 extern orxDLLAPI const orxSTRING orxSTRING_FALSE;
215 extern orxDLLAPI const orxSTRING orxSTRING_EOL;
216 
217 #define orxCHAR_NULL '\0'
218 #define orxCHAR_CR '\r'
219 #define orxCHAR_LF '\n'
220 #define orxCHAR_EOL '\n'
221 #define orxCHAR_ASCII_NUMBER 128
222 
223 #define _orxSTRINGIFY(X) #X
224 #define orxSTRINGIFY(X) _orxSTRINGIFY(X)
225 
226 
227 /* *** Directory separators *** */
228 
229 extern orxDLLAPI const orxSTRING orxSTRING_DIRECTORY_SEPARATOR;
230 
231 #define orxCHAR_DIRECTORY_SEPARATOR_WINDOWS '\\'
232 #define orxCHAR_DIRECTORY_SEPARATOR_LINUX '/'
233 
234 #if defined(__orxWINDOWS__)
235 
236 #define orxCHAR_DIRECTORY_SEPARATOR '\\'
237 
238 #elif defined(__orxLINUX__) || defined(__orxMAC__) || defined(__orxIOS__) || defined(__orxANDROID__) || defined(__orxANDROID_NATIVE__)
239 
240 #define orxCHAR_DIRECTORY_SEPARATOR '/'
241 
242 #endif
243 
244 
245 /* *** Status defines *** */
246 typedef enum __orxSTATUS_t
247 {
253  orxSTATUS_NONE = orxENUM_NONE
255 } orxSTATUS;
256 
257 #endif /*_orxTYPE_H_*/
258 
static const orxSTRINGID orxSTRINGID_UNDEFINED
Definition: orxType.h:208
static const orxDOUBLE orxDOUBLE_MAX
Definition: orxType.h:199
orxDLLAPI const orxSTRING orxSTRING_DIRECTORY_SEPARATOR
static const orxDOUBLE orxDOUBLE_0
Definition: orxType.h:197
static const orxFLOAT orxFLOAT_1
Definition: orxType.h:193
static const orxU32 orxU32_UNDEFINED
Definition: orxType.h:204
orxDLLAPI const orxSTRING orxSTRING_EMPTY
orxDLLAPI const orxSTRING orxSTRING_TRUE
orxSTATUS
Definition: orxType.h:246
static const orxU64 orxU64_UNDEFINED
Definition: orxType.h:203
static const orxDOUBLE orxDOUBLE_1
Definition: orxType.h:198
orxSEEK_OFFSET_WHENCE
Definition: orxType.h:173
#define orxDLLAPI
Definition: orxDecl.h:381
static const orxFLOAT orxFLOAT_0
Definition: orxType.h:192
static const orxU16 orxU16_UNDEFINED
Definition: orxType.h:205
orxDLLAPI const orxSTRING orxSTRING_FALSE
static const orxFLOAT orxFLOAT_MAX
Definition: orxType.h:194
orxDLLAPI const orxSTRING orxSTRING_EOL
static const orxHANDLE orxHANDLE_UNDEFINED
Definition: orxType.h:207
static const orxU8 orxU8_UNDEFINED
Definition: orxType.h:206

Generated for orx by doxygen 1.8.11