ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sqconfig.h
1 
2 #ifdef _SQ64
3 
4 #ifdef _MSC_VER
5 typedef __int64 SQInteger;
6 typedef unsigned __int64 SQUnsignedInteger;
7 typedef unsigned __int64 SQHash; /*should be the same size of a pointer*/
8 #else
9 typedef long long SQInteger;
10 typedef unsigned long long SQUnsignedInteger;
11 typedef unsigned long long SQHash; /*should be the same size of a pointer*/
12 #endif
13 typedef int SQInt32;
14 typedef unsigned int SQUnsignedInteger32;
15 #else
16 typedef int SQInteger;
17 typedef int SQInt32; /*must be 32 bits(also on 64bits processors)*/
18 typedef unsigned int SQUnsignedInteger32; /*must be 32 bits(also on 64bits processors)*/
19 typedef unsigned int SQUnsignedInteger;
20 typedef unsigned int SQHash; /*should be the same size of a pointer*/
21 #endif
22 
23 
24 #ifdef SQUSEDOUBLE
25 typedef double SQFloat;
26 #else
27 typedef float SQFloat;
28 #endif
29 
30 #if defined(SQUSEDOUBLE) && !defined(_SQ64) || !defined(SQUSEDOUBLE) && defined(_SQ64)
31 #ifdef _MSC_VER
32 typedef __int64 SQRawObjectVal; //must be 64bits
33 #else
34 typedef long long SQRawObjectVal; //must be 64bits
35 #endif
36 #define SQ_OBJECT_RAWINIT() { _unVal.raw = 0; }
37 #else
38 typedef SQUnsignedInteger SQRawObjectVal; //is 32 bits on 32 bits builds and 64 bits otherwise
39 #define SQ_OBJECT_RAWINIT()
40 #endif
41 
42 #ifndef SQ_ALIGNMENT // SQ_ALIGNMENT shall be less than or equal to SQ_MALLOC alignments, and its value shall be power of 2.
43 #if defined(SQUSEDOUBLE) || defined(_SQ64)
44 #define SQ_ALIGNMENT 8
45 #else
46 #define SQ_ALIGNMENT 4
47 #endif
48 #endif
49 
50 typedef void* SQUserPointer;
51 typedef SQUnsignedInteger SQBool;
52 typedef SQInteger SQRESULT;
53 
54 typedef char SQChar;
55 #define _SC(a) a
56 #define scstrcmp strcmp
57 #ifdef _MSC_VER
58 #define scsprintf _snprintf
59 #else
60 #define scsprintf snprintf
61 #endif
62 #define scstrlen strlen
63 #define scstrtod strtod
64 #ifdef _SQ64
65 #ifdef _MSC_VER
66 #define scstrtol _strtoi64
67 #else
68 #define scstrtol strtoll
69 #endif
70 #else
71 #define scstrtol strtol
72 #endif
73 #define scstrtoul strtoul
74 #define scvsprintf vsnprintf
75 #define scstrstr strstr
76 #define scisspace isspace
77 #define scisdigit isdigit
78 #define scisprint isprint
79 #define scisxdigit isxdigit
80 #define sciscntrl iscntrl
81 #define scisalpha isalpha
82 #define scisalnum isalnum
83 #define scprintf printf
84 #define MAX_CHAR 0xFF
85 
86 #define sq_rsl(l) (l)
87 
88 #ifdef _SQ64
89 #define _PRINT_INT_PREC _SC("ll")
90 #define _PRINT_INT_FMT _SC("%lld")
91 #else
92 #define _PRINT_INT_FMT _SC("%d")
93 #endif