From 669aa1fbcfe35b917b3810b9ef5520bd869d590e Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Thu, 12 Jan 2017 09:27:22 +0100
Subject: [PATCH] fix duplicated definition of boolean_t

It is defined both in openair2/COMMON/commonDef.h and
openair2/COMMON/platform_types.h.

Removing one or the other definition creates many problems
when compiling this or that part of the system (ue_ip.ko,
at_nas_ue). Let's keep both and protect the definitions
inside #ifdefs.
---
 openair2/COMMON/commonDef.h      | 9 +++++++++
 openair2/COMMON/platform_types.h | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/openair2/COMMON/commonDef.h b/openair2/COMMON/commonDef.h
index cfd5d68e40a..b1ec47449af 100644
--- a/openair2/COMMON/commonDef.h
+++ b/openair2/COMMON/commonDef.h
@@ -43,6 +43,13 @@ Description Contains global common definitions
 #include <stddef.h>
 #include <stdbool.h>
 
+/* boolean_t is also defined in openair2/COMMON/platform_types.h
+ * let's protect potential redefinition
+ */
+
+#ifndef _BOOLEAN_T_DEFINED_
+#define _BOOLEAN_T_DEFINED_
+
 typedef signed char        boolean_t;
 
 #if !defined(TRUE)
@@ -55,6 +62,8 @@ typedef signed char        boolean_t;
 
 #define BOOL_NOT(b) (b^TRUE)
 
+#endif /* _BOOLEAN_T_DEFINED_ */
+
 #define NAS_UE_ID_FMT "0x%06x"
 
 /****************************************************************************/
diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h
index 327523f1d03..b17e7d77242 100644
--- a/openair2/COMMON/platform_types.h
+++ b/openair2/COMMON/platform_types.h
@@ -40,6 +40,13 @@
 //-----------------------------------------------------------------------------
 // GENERIC TYPES
 //-----------------------------------------------------------------------------
+
+/* boolean_t is also defined in openair2/COMMON/commonDef.h,
+ * let's protect potential redefinition
+ */
+#ifndef _BOOLEAN_T_DEFINED_
+#define _BOOLEAN_T_DEFINED_
+
 typedef signed char        boolean_t;
 
 #if !defined(TRUE)
@@ -52,6 +59,8 @@ typedef signed char        boolean_t;
 
 #define BOOL_NOT(b) (b^TRUE)
 
+#endif /* _BOOLEAN_T_DEFINED_ */
+
 //-----------------------------------------------------------------------------
 // GENERIC ACCESS STRATUM TYPES
 //-----------------------------------------------------------------------------
-- 
GitLab