Use the same definition of 'bool' as in uio.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2953 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2008-03-14 20:31:17 +00:00
parent 76ba833da4
commit 3689bdaaf7
+23 -6
View File
@@ -22,6 +22,8 @@
#ifndef _TYPES_H #ifndef _TYPES_H
#define _TYPES_H #define _TYPES_H
#include "config.h"
#ifdef _MSC_VER #ifdef _MSC_VER
# if (_MSC_VER >= 1300) # if (_MSC_VER >= 1300)
# include <stddef.h> # include <stddef.h>
@@ -84,14 +86,29 @@
# undef UQM_INT64 # undef UQM_INT64
#endif #endif
// ISO C99 compatible boolean types. The ISO C99 standard defines:
// - An object declared as type _Bool, large enough to store the values 0
// and 1, the rank of which is less than the rank of all other standard
// integer types.
// - A macro "bool", which expands to "_Bool".
// - A macro "true", which expands to the integer constant 1, suitable for
// use in #if preprocessing directives.
// - A macro "false", which expands to the integer constant 0, suitable for
// use in #if preprocessing directives.
// - A macro "__bool_true_false_are_defined", which expands to the integer
// constant 1, suitable for use in #if preprocessing directives.
#ifndef __bool_true_false_are_defined
#undef bool
#undef false #undef false
#undef true #undef true
#undef bool #ifndef HAVE__BOOL
typedef enum typedef unsigned char _Bool;
{ #endif /* HAVE_BOOL */
false = 0, #define bool _Bool
true = 1 #define true 1
} bool; #define false 0
#define __bool_true_false_are_defined
#endif /* __bool_true_false_are_defined */
/* If it isn't char, what is it ?!*/ /* If it isn't char, what is it ?!*/
typedef unsigned char uint8; typedef unsigned char uint8;