43 typedef unsigned char uchar;
53 static const int32 kMaxLong = kMaxInt32;
54 static const int32 kMinLong = kMinInt32;
66 typedef int32 tresult;
68 static const float kMaxFloat = 3.40282346638528860E38;
69 static const double kMaxDouble = 1.7976931348623158E308;
72 typedef uint64 TPtrInt;
74 typedef uint32 TPtrInt;
84 typedef char16_t char16;
92 typedef const char8* CStringA;
93 typedef const char16* CStringW;
94 typedef const tchar* CString;
95 inline bool strEmpty (
const tchar* str) {
return (!str || *str == 0); }
96 inline bool str8Empty (
const char8* str) {
return (!str || *str == 0); }
97 inline bool str16Empty (
const char16* str) {
return (!str || *str == 0); }
99 typedef const char8* FIDString;
101 const FIDString kPlatformStringWin =
"WIN";
102 const FIDString kPlatformStringMac =
"MAC";
103 const FIDString kPlatformStringIOS =
"IOS";
104 const FIDString kPlatformStringLinux =
"Linux";
106 const FIDString kPlatformString = kPlatformStringWin;
108 const FIDString kPlatformString = kPlatformStringIOS;
110 const FIDString kPlatformString = kPlatformStringMac;
112 const FIDString kPlatformString = kPlatformStringLinux;
126#define SWAP_32(l) { \
127 unsigned char* p = (unsigned char*)& (l); \
129 t = p[0]; p[0] = p[3]; p[3] = t; t = p[1]; p[1] = p[2]; p[2] = t; }
131#define SWAP_16(w) { \
132 unsigned char* p = (unsigned char*)& (w); \
134 t = p[0]; p[0] = p[1]; p[1] = t; }
136#define SWAP_64(i) { \
137 unsigned char* p = (unsigned char*)& (i); \
139 t = p[0]; p[0] = p[7]; p[7] = t; t = p[1]; p[1] = p[6]; p[6] = t; \
140 t = p[2]; p[2] = p[5]; p[5] = t; t = p[3]; p[3] = p[4]; p[4] = t;}
144 static inline void FSwap (int8&) {}
145 static inline void FSwap (uint8&) {}
146 static inline void FSwap (int16& i16) { SWAP_16 (i16) }
147 static inline void FSwap (uint16& i16) { SWAP_16 (i16) }
148 static inline void FSwap (int32& i32) {
SWAP_32 (i32) }
149 static inline void FSwap (uint32& i32) {
SWAP_32 (i32) }
150 static inline void FSwap (int64& i64) { SWAP_64 (i64) }
151 static inline void FSwap (uint64& i64) { SWAP_64 (i64) }
157 #if SMTG_OS_MACOS || SMTG_OS_LINUX || defined(__MINGW32__)
158 #define SMTG_ALWAYS_INLINE __inline__ __attribute__((__always_inline__))
159 #define SMTG_NEVER_INLINE __attribute__((noinline))
160 #elif SMTG_OS_WINDOWS
161 #define SMTG_ALWAYS_INLINE __forceinline
162 #define SMTG_NEVER_INLINE __declspec(noinline)
166#ifndef SMTG_ALWAYS_INLINE
167 #define SMTG_ALWAYS_INLINE inline
169#ifndef SMTG_NEVER_INLINE
170 #define SMTG_NEVER_INLINE
173#ifndef SMTG_CPP11_STDLIBSUPPORT
#define SWAP_32(l)
Byte-order Conversion Macros.