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

37 files changed:
Makefile.am
src/CommonAPI/DBus/DBusAddressTranslator.h
src/CommonAPI/DBus/DBusAttribute.h
src/CommonAPI/DBus/DBusConnection.h
src/CommonAPI/DBus/DBusDaemonProxy.h
src/CommonAPI/DBus/DBusError.h
src/CommonAPI/DBus/DBusEvent.h
src/CommonAPI/DBus/DBusFactory.h
src/CommonAPI/DBus/DBusFunctionalHash.h
src/CommonAPI/DBus/DBusHelper.h
src/CommonAPI/DBus/DBusInputStream.h
src/CommonAPI/DBus/DBusLegacyVariant.h
src/CommonAPI/DBus/DBusMainLoopContext.h
src/CommonAPI/DBus/DBusMessage.h
src/CommonAPI/DBus/DBusMultiEvent.h
src/CommonAPI/DBus/DBusObjectManager.h
src/CommonAPI/DBus/DBusOutputStream.h
src/CommonAPI/DBus/DBusProxy.h
src/CommonAPI/DBus/DBusProxyAsyncCallbackHandler.h
src/CommonAPI/DBus/DBusProxyBase.h
src/CommonAPI/DBus/DBusProxyConnection.h
src/CommonAPI/DBus/DBusProxyHelper.h
src/CommonAPI/DBus/DBusRuntime.h
src/CommonAPI/DBus/DBusSerializableArguments.h
src/CommonAPI/DBus/DBusServicePublisher.h
src/CommonAPI/DBus/DBusServiceRegistry.h
src/CommonAPI/DBus/DBusServiceStatusEvent.h
src/CommonAPI/DBus/DBusStubAdapter.h
src/CommonAPI/DBus/DBusStubAdapterHelper.h
src/CommonAPI/DBus/DBusUtils.h
src/test/DBusAddressTranslatorTest.cpp
src/test/DBusCommunicationTest.cpp
src/test/DBusFactoryTest.cpp
src/test/DBusMainLoopIntegrationTest.cpp
src/test/DBusMultipleConnectionTest.cpp
src/test/DBusServicePublisherTest.cpp
src/test/DBusServiceRegistryTest.cpp

index 15dd21f..14bff6b 100644 (file)
@@ -8,7 +8,8 @@ AM_CPPFLAGS = \
         -I$(top_srcdir)/src \
         -I$(top_srcdir)/src/test \
         ${COMMONAPI_CFLAGS} \
-        ${DBUS_CFLAGS}
+        ${DBUS_CFLAGS} \
+        -DCOMMONAPI_INTERNAL_COMPILATION
 
 
 AM_LDFLAGS = \
index de38f4e..9c58018 100644 (file)
@@ -5,6 +5,9 @@
  * 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 DBUSNAMESERVICE_H_
 #define DBUSNAMESERVICE_H_
index 89cc61a..eb77384 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_DBUS_DBUS_ATTRIBUTE_H_
 #define COMMONAPI_DBUS_DBUS_ATTRIBUTE_H_
 
index 83d02a4..39fe1e1 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_DBUS_DBUS_CONNECTION_H_
 #define COMMONAPI_DBUS_DBUS_CONNECTION_H_
 
index 0053c1b..ca4d248 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_DBUS_DBUS_DAEMON_PROXY_H_
 #define COMMONAPI_DBUS_DBUS_DAEMON_PROXY_H_
 
index b01ea98..8feaa99 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_DBUS_DBUS_ERROR_H_
 #define COMMONAPI_DBUS_DBUS_ERROR_H_
 
index 561fa04..4bd235d 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_DBUS_DBUS_EVENT_H_
 #define COMMONAPI_DBUS_DBUS_EVENT_H_
 
index 3775944..d2ee0d9 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_DBUS_DBUS_FACTORY_H_
 #define COMMONAPI_DBUS_DBUS_FACTORY_H_
 
index 9736ac9..ba8cfb8 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_DBUS_DBUS_FUNCTIONAL_HASH_H_
 #define COMMONAPI_DBUS_DBUS_FUNCTIONAL_HASH_H_
 
index 7d29705..bcf80d1 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_DBUS_DBUS_HELPER_H_
 #define COMMONAPI_DBUS_DBUS_HELPER_H_
 
index fb190c9..3edd874 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_DBUS_DBUS_INPUT_STREAM_H_
 #define COMMONAPI_DBUS_DBUS_INPUT_STREAM_H_
 
index 1403dea..0ac9df6 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 DBUSLEGACYVARIANT_H_
 #define DBUSLEGACYVARIANT_H_
 
index 602720d..7e59535 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 DBUS_MAINLOOPCONTEXT_H_
 #define DBUS_MAINLOOPCONTEXT_H_
 
index 558654e..0a77bde 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_DBUS_DBUS_MESSAGE_H_
 #define COMMONAPI_DBUS_DBUS_MESSAGE_H_
 
index 910c8c1..a98dd80 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_DBUS_DBUS_MULTI_EVENT_H_
 #define COMMONAPI_DBUS_DBUS_MULTI_EVENT_H_
 
index cb60948..55bcb62 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_DBUS_DBUS_OBJECT_MANAGER_H_
 #define COMMONAPI_DBUS_DBUS_OBJECT_MANAGER_H_
 
index 229eefc..9c7105f 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_DBUS_DBUS_OUTPUT_MESSAGE_STREAM_H_
 #define COMMONAPI_DBUS_DBUS_OUTPUT_MESSAGE_STREAM_H_
 
index 977b006..253f0bb 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_DBUS_DBUS_PROXY_H_
 #define COMMONAPI_DBUS_DBUS_PROXY_H_
 
index 0c6d56e..74bb244 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_DBUS_DBUS_PROXY_ASYNC_CALLBACK_HANDLER_H_
 #define COMMONAPI_DBUS_DBUS_PROXY_ASYNC_CALLBACK_HANDLER_H_
 
index 454d03f..d1310b7 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_DBUS_DBUS_PROXY_BASE_H_
 #define COMMONAPI_DBUS_DBUS_PROXY_BASE_H_
 
index c346c44..bd117a0 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_DBUS_DBUS_PROXY_CONNECTION_H_
 #define COMMONAPI_DBUS_DBUS_PROXY_CONNECTION_H_
 
index 48433d7..4a40602 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_DBUS_DBUS_PROXY_HELPER_H_
 #define COMMONAPI_DBUS_DBUS_PROXY_HELPER_H_
 
index 928385f..f9d222e 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_DBUS_DBUS_RUNTIME_H_
 #define COMMONAPI_DBUS_DBUS_RUNTIME_H_
 
index 53f4e55..bab1a68 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_DBUS_SERIALIZABLE_ARGUMENTS_H_
 #define COMMONAPI_DBUS_SERIALIZABLE_ARGUMENTS_H_
 
index 6e7cdfc..4559386 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_DBUS_DBUS_SERVICE_PUBLISHER_H_
 #define COMMONAPI_DBUS_DBUS_SERVICE_PUBLISHER_H_
 
index c03fb92..28dd6a1 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_DBUS_DBUS_SERVICE_REGISTRY_H_
 #define COMMONAPI_DBUS_DBUS_SERVICE_REGISTRY_H_
 
index e81ba7e..4e8956a 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_DBUS_DBUS_SERVICE_STATUS_EVENT_H_
 #define COMMONAPI_DBUS_DBUS_SERVICE_STATUS_EVENT_H_
 
index 0382e61..5bac530 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_DBUS_DBUS_STUB_ADAPTER_H_
 #define COMMONAPI_DBUS_DBUS_STUB_ADAPTER_H_
 
index ee627a3..b936f57 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_DBUS_DBUS_STUB_ADAPTER_HELPER_H_
 #define COMMONAPI_DBUS_DBUS_STUB_ADAPTER_HELPER_H_
 
index be39f28..22879d1 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 DBUSUTILS_H_
 #define DBUSUTILS_H_
 
index 468644d..bafe79f 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <CommonAPI/CommonAPI.h>
 
+#define COMMONAPI_INTERNAL_COMPILATION
+
 #include <CommonAPI/DBus/DBusAddressTranslator.h>
 #include <CommonAPI/DBus/DBusUtils.h>
 #include <CommonAPI/DBus/DBusConnection.h>
index a2c8072..bc8af66 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <CommonAPI/CommonAPI.h>
 
+#define COMMONAPI_INTERNAL_COMPILATION
+
 #include <CommonAPI/DBus/DBusConnection.h>
 #include <CommonAPI/DBus/DBusProxy.h>
 #include <CommonAPI/DBus/DBusRuntime.h>
index 0143080..523cce5 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <CommonAPI/CommonAPI.h>
 
+#define COMMONAPI_INTERNAL_COMPILATION
+
 #include <CommonAPI/DBus/DBusConnection.h>
 #include <CommonAPI/DBus/DBusProxy.h>
 #include <CommonAPI/DBus/DBusRuntime.h>
index e80913b..baa77ae 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <CommonAPI/CommonAPI.h>
 
+#define COMMONAPI_INTERNAL_COMPILATION
+
 #include <CommonAPI/DBus/DBusConnection.h>
 #include <CommonAPI/DBus/DBusProxy.h>
 #include <CommonAPI/DBus/DBusRuntime.h>
index 1396bd5..c061d2f 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <CommonAPI/CommonAPI.h>
 
+#define COMMONAPI_INTERNAL_COMPILATION
+
 #include "commonapi/tests/TestInterfaceProxy.h"
 #include "commonapi/tests/TestInterfaceStubDefault.h"
 
index fa67183..0124a43 100644 (file)
@@ -19,6 +19,9 @@
 #include <type_traits>
 
 #include <CommonAPI/CommonAPI.h>
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
 #include <CommonAPI/AttributeExtension.h>
 #include <CommonAPI/types.h>
 
index af54a7e..a1321d1 100644 (file)
@@ -9,6 +9,9 @@
 #endif
 
 #include <CommonAPI/CommonAPI.h>
+
+#define COMMONAPI_INTERNAL_COMPILATION
+
 #include <CommonAPI/DBus/DBusServiceRegistry.h>
 #include <CommonAPI/DBus/DBusConnection.h>
 #include <CommonAPI/DBus/DBusUtils.h>