Skip to content
Snippets Groups Projects
Commit a125b8be authored by Ahmed Abd El Mawgood's avatar Ahmed Abd El Mawgood
Browse files

Make stdbool.h C++ compatiable

The problem here is that _Bool type is not defined in C++ yet this file
is using it. That leads to issues when compiling gcc. I borrowed the
same techniques used in other stdbool.h
parent 68679e41
No related branches found
No related tags found
No related merge requests found
#ifndef _STDBOOL_H #ifndef _STDBOOL_H
#define _STDBOOL_H #define _STDBOOL_H
#ifndef __cplusplus
typedef _Bool bool; typedef _Bool bool;
#define true 1 #define true 1
#define false 0 #define false 0
#else /* __cplusplus */
typedef bool _Bool;
#if __cplusplus < 201103L
#define false false
#define true true
#endif /*__cplusplus < 201103L*/
#endif /* __cplusplus */
#define __bool_true_false_are_defined 1 #define __bool_true_false_are_defined 1
#endif /* _STDBOOL_H */ #endif /* _STDBOOL_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment