Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _STDBOOL_H
- #define _STDBOOL_H
- /* C99 Boolean types for compilers without C99 support */
- /* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */
- #if !defined(__cplusplus)
- #if !defined(__GNUC__)
- /* _Bool builtin type is included in GCC */
- typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
- #endif
- #define bool _Bool
- #define true 1
- #define false 0
- #define __bool_true_false_are_defined 1
- #endif
- #endif
- //#define bool _Bool
- #define bool unsigned char
- #ifndef _STDBOOL_H
- #define _STDBOOL_H
- #include
- /* C99 Boolean types for compilers without C99 support */
- /* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */
- #if !defined(__cplusplus)
- #if !defined(__GNUC__)
- /* _Bool builtin type is included in GCC */
- /* ISO C Standard: 5.2.5 An object declared as
- type _Bool is large enough to store
- the values 0 and 1. */
- /* We choose 8 bit to match C++ */
- /* It must also promote to integer */
- typedef int8_t _Bool;
- #endif
- /* ISO C Standard: 7.16 Boolean type */
- #define bool _Bool
- #define true 1
- #define false 0
- #define __bool_true_false_are_defined 1
- #endif
- #endif
- union boolean {
- bool value_cpp;
- int value_c;
- };
- extern "C" bool library_func_1(int i, char c, bool b);
- bool library_func_1_cpp(int i, char c, bool b)
- {
- int result = library_func_1(i, c, static_cast<int>(b));
- return (result==true);
- }
Add Comment
Please, Sign In to add comment