bool type added; assertion macro fix

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@579 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2003-01-25 19:30:06 +00:00
parent 659dd69454
commit 08710150e6
+7 -1
View File
@@ -55,6 +55,12 @@
# undef HAVE_NATIVE_64 # undef HAVE_NATIVE_64
#endif #endif
typedef enum
{
false = 0,
true
} bool;
/* If it isn't char, what is it ?!*/ /* If it isn't char, what is it ?!*/
typedef unsigned char uint8; typedef unsigned char uint8;
typedef signed char sint8; typedef signed char sint8;
@@ -101,7 +107,7 @@ typedef struct
* error during compile, if the actual size of a type is wrong * error during compile, if the actual size of a type is wrong
*/ */
#define UQM_COMPILE_TIME_ASSERT(name, x) \ #define UQM_COMPILE_TIME_ASSERT(name, x) \
typedef int UQM_dummy_##name## [(x) * 2 - 1] typedef int UQM_dummy_##name [(x) * 2 - 1]
UQM_COMPILE_TIME_ASSERT(uint8, sizeof(uint8) == 1); UQM_COMPILE_TIME_ASSERT(uint8, sizeof(uint8) == 1);
UQM_COMPILE_TIME_ASSERT(uint16, sizeof(uint16) == 2); UQM_COMPILE_TIME_ASSERT(uint16, sizeof(uint16) == 2);