Made uio "bool" compatible with the main uqm "bool";

introduced C99 compatible booleans.



git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2856 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
Meep-Eep
2007-09-18 14:48:17 +00:00
parent 85b9898d53
commit e802b489b8
4 changed files with 36 additions and 6 deletions
+3
View File
@@ -47,6 +47,9 @@ uqm_requirements()
define_have_symbol getopt_long define_have_symbol getopt_long
define_have_header regex.h define_have_header regex.h
# Add define for HAVE__BOOL
define_have_type _Bool
# Add an environment variable for MACRO_WIN32 and MACRO___MINGW32__ # Add an environment variable for MACRO_WIN32 and MACRO___MINGW32__
define_have_macro WIN32 define_have_macro WIN32
define_have_macro __MINGW32__ define_have_macro __MINGW32__
+3 -1
View File
@@ -52,6 +52,8 @@
/* Defined if your system has wint_t of its own */ /* Defined if your system has wint_t of its own */
@HAVE_WINT_T@ @HAVE_WINT_T@
/* Defined if your system has _Bool of its own */
@HAVE__BOOL@
#endif /* _CONFIG_UNIX_H */ #endif /* _CONFIG_UNIX_H */
+3
View File
@@ -53,6 +53,9 @@
/* Defined if your system has wint_t of its own */ /* Defined if your system has wint_t of its own */
@HAVE_WINT_T@ @HAVE_WINT_T@
/* Defined if your system has _Bool of its own */
@HAVE__BOOL@
#endif /* _CONFIG_WIN_H */ #endif /* _CONFIG_WIN_H */
+27 -5
View File
@@ -21,11 +21,33 @@
#ifndef _uio_TYPES_H #ifndef _uio_TYPES_H
#define _uio_TYPES_H #define _uio_TYPES_H
typedef enum #include "config.h"
{
false = 0, // ISO C99 compatible boolean types. The ISO C99 standard defines:
true // - An object declared as type _Bool, large enough to store the values 0
} uio_bool; // 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 true
#ifndef HAVE__BOOL
typedef unsigned char _Bool;
#endif /* HAVE_BOOL */
#define bool _Bool
#define true 1
#define false 0
#define __bool_true_false_are_defined
#endif /* __bool_true_false_are_defined */
typedef bool uio_bool;
typedef unsigned char uio_uint8; typedef unsigned char uio_uint8;
typedef signed char uio_sint8; typedef signed char uio_sint8;