[PATCH] Avoid redefinition of typedef ‘bool’

subsurface at henrik.synth.no subsurface at henrik.synth.no
Sun May 5 23:07:03 PDT 2013


From: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>

The compiler on MacOSX wouldn't build Subsurface when bool
was redefined.

Signed-off-by: Henrik Brautaset Aronsen <subsurface at henrik.synth.no>
---
 display.h  | 6 ------
 dive.h     | 7 ++++++-
 divelist.h | 6 ------
 profile.h  | 6 ------
 4 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/display.h b/display.h
index bc60c05..047d005 100644
--- a/display.h
+++ b/display.h
@@ -3,12 +3,6 @@
 
 #ifdef __cplusplus
 extern "C" {
-#else
-#if __STDC_VERSION__ >= 199901L
-#include <stdbool.h>
-#else
-typedef int bool;
-#endif
 #endif
 
 #define SCALE_SCREEN 1.0
diff --git a/dive.h b/dive.h
index c13cac0..0c2e5b7 100644
--- a/dive.h
+++ b/dive.h
@@ -17,6 +17,12 @@
 
 #ifdef __cplusplus
 extern "C" {
+#else
+#if __STDC_VERSION__ >= 199901L
+#include <stdbool.h>
+#else
+typedef int bool;
+#endif
 #endif
 
 #define O2_IN_AIR		209     // permille
@@ -32,7 +38,6 @@ extern "C" {
 #define SEAWATER_SALINITY	10300
 #define FRESHWATER_SALINITY	10000
 
-
 /*
  * Some silly typedefs to make our units very explicit.
  *
diff --git a/divelist.h b/divelist.h
index d17ea7c..01ef613 100644
--- a/divelist.h
+++ b/divelist.h
@@ -3,12 +3,6 @@
 
 #ifdef __cplusplus
 extern "C" {
-#else
-#if __STDC_VERSION__ >= 199901L
-#include <stdbool.h>
-#else
-typedef int bool;
-#endif
 #endif
 
 struct dive;
diff --git a/profile.h b/profile.h
index 2c293fa..b3cc48a 100644
--- a/profile.h
+++ b/profile.h
@@ -3,12 +3,6 @@
 
 #ifdef __cplusplus
 extern "C" {
-#else
-#if __STDC_VERSION__ >= 199901L
-#include <stdbool.h>
-#else
-typedef int bool;
-#endif
 #endif
 
 #include "dive.h"
-- 
1.8.2.1



More information about the subsurface mailing list