Add compile guard macro
authorJohannes Schanda <schanda@itestra.de>
Mon, 17 Jun 2013 09:44:09 +0000 (11:44 +0200)
committerJohannes Schanda <schanda@itestra.de>
Mon, 17 Jun 2013 09:44:09 +0000 (11:44 +0200)
- Sets a macro preventing inclusion of internal files
- Adds makefile defenition to enable build

17 files changed:
Makefile.am
src/CommonAPI/Attribute.h
src/CommonAPI/AttributeExtension.h
src/CommonAPI/CommonAPI.h
src/CommonAPI/Event.h
src/CommonAPI/Factory.h
src/CommonAPI/InputStream.h
src/CommonAPI/MainLoopContext.h
src/CommonAPI/MiddlewareInfo.h
src/CommonAPI/OutputStream.h
src/CommonAPI/Proxy.h
src/CommonAPI/Runtime.h
src/CommonAPI/SerializableStruct.h
src/CommonAPI/SerializableVariant.h
src/CommonAPI/ServicePublisher.h
src/CommonAPI/Stub.h
src/CommonAPI/types.h

index aa85c06..8a94c7c 100644 (file)
@@ -6,6 +6,9 @@ LIBCOMMONAPI_CURRENT=2
 LIBCOMMONAPI_REVISION=0
 LIBCOMMONAPI_AGE=0
 
+AM_CPPFLAGS = \
+        -DCOMMONAPI_INTERNAL_COMPILATION
+
 # ------------------------------------------------------------------------------
 # Doxygen
 include $(top_srcdir)/aminclude.am 
index d9c2391..aa5a213 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_ATTRIBUTE_H_
 #define COMMONAPI_ATTRIBUTE_H_
 
index 4a1b4d6..d73c2a3 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMON_API_DBUS_ATTRIBUTE_EXTENSION_H_
 #define COMMON_API_DBUS_ATTRIBUTE_EXTENSION_H_
 
index 332c5d8..f72d1d2 100644 (file)
@@ -9,14 +9,14 @@
 #define COMMONAPI_H_
 
 
-#define COMMONAPI_COMPILATION
+#define COMMONAPI_INTERNAL_COMPILATION
 
 #include "Runtime.h"
 #include "Factory.h"
 #include "AttributeExtension.h"
 #include "types.h"
 
-#undef COMMONAPI_COMPILATION
+#undef COMMONAPI_INTERNAL_COMPILATION
 
 
 #endif /* COMMONAPI_H_ */
index 6c7c1cf..b86f58c 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_EVENT_H_
 #define COMMONAPI_EVENT_H_
 
index f0f1b0d..e5d5993 100644 (file)
@@ -5,6 +5,10 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_FACTORY_H_
 #define COMMONAPI_FACTORY_H_
 
index 3e03f76..e7c3e10 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_INPUT_STREAM_H_
 #define COMMONAPI_INPUT_STREAM_H_
 
index a391db4..0d87442 100644 (file)
@@ -5,6 +5,10 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_MAIN_LOOP_CONTEXT_H_
 #define COMMONAPI_MAIN_LOOP_CONTEXT_H_
 
index a81076a..6b69691 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef MIDDLEWAREINFO_H_
 #define MIDDLEWAREINFO_H_
 
index 517aaa8..9a4a521 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_OUTPUT_STREAM_H_
 #define COMMONAPI_OUTPUT_STREAM_H_
 
index 186af1d..59575ff 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_PROXY_H_
 #define COMMONAPI_PROXY_H_
 
index 937047b..7b666b6 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_RUNTIME_H_
 #define COMMONAPI_RUNTIME_H_
 
index 0de7e15..c704387 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_SERIALIZABLE_STRUCT_H_
 #define COMMONAPI_SERIALIZABLE_STRUCT_H_
 
index a842fda..a1b02de 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_SERIALIZABLE_VARIANT_H_
 #define COMMONAPI_SERIALIZABLE_VARIANT_H_
 
index 43bbeb9..0fce54f 100644 (file)
@@ -5,6 +5,10 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_SERVICE_PUBLISHER_H_
 #define COMMONAPI_SERVICE_PUBLISHER_H_
 
index 7353f54..22892f4 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_STUB_H_
 #define COMMONAPI_STUB_H_
 
index 413f428..c7fdeb8 100644 (file)
@@ -4,6 +4,11 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if !defined (COMMONAPI_INTERNAL_COMPILATION)
+#error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
+#endif
+
 #ifndef COMMONAPI_TYPES_H_
 #define COMMONAPI_TYPES_H_