Browse Source

Added stdbool import and mapped sc_boolean to bool type (C99 compatible).

markus.muehlbrandt@gmail.com 11 years ago
parent
commit
9a1e5de879

+ 6 - 6
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Types.xtend

@@ -37,11 +37,7 @@ class Types {
 		#endif 
 		
 		#include <stdint.h>
-		
-		typedef enum {
-			bool_false,
-			bool_true
-		} sc_boolean;
+		#include <stdbool.h>
 		
 		typedef int_fast16_t  sc_short;
 		typedef uint_fast16_t sc_ushort;
@@ -54,7 +50,11 @@ class Types {
 		
 		#ifdef __cplusplus
 		}
-		#endif 
+		#endif
+		
+		#define sc_boolean bool
+		#define bool_true true
+		#define bool_false false
 
 		#endif /* «typesModule.define»_H_ */
 	'''