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

Generated for orx by doxygen 1.5.6