aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-10-03 13:01:25 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-10-04 10:17:12 +0200
commit433fdea6d4107dcbe7848a28aa492c44742a00c2 (patch)
tree5f7fe2aac107b3ac7de99f6fc361380018965209
parentc250fa3797b40f70cbac1d9e417b1d3ad946ee89 (diff)
libmm-glib: only allow including `libmm-glib.h' directly
Unless when compiling libmm-glib itself, of course.
-rw-r--r--libmm-glib/Makefile.am3
-rw-r--r--libmm-glib/libmm-glib.h4
-rw-r--r--libmm-glib/mm-bearer-ip-config.h4
-rw-r--r--libmm-glib/mm-bearer-properties.h4
-rw-r--r--libmm-glib/mm-bearer.h4
-rw-r--r--libmm-glib/mm-common-helpers.h4
-rw-r--r--libmm-glib/mm-firmware-properties.h4
-rw-r--r--libmm-glib/mm-location-3gpp.h4
-rw-r--r--libmm-glib/mm-location-gps-nmea.h4
-rw-r--r--libmm-glib/mm-location-gps-raw.h4
-rw-r--r--libmm-glib/mm-manager.h4
-rw-r--r--libmm-glib/mm-modem-3gpp-ussd.h4
-rw-r--r--libmm-glib/mm-modem-3gpp.h4
-rw-r--r--libmm-glib/mm-modem-cdma.h4
-rw-r--r--libmm-glib/mm-modem-firmware.h4
-rw-r--r--libmm-glib/mm-modem-location.h4
-rw-r--r--libmm-glib/mm-modem-messaging.h4
-rw-r--r--libmm-glib/mm-modem-simple.h4
-rw-r--r--libmm-glib/mm-modem-time.h4
-rw-r--r--libmm-glib/mm-modem.h4
-rw-r--r--libmm-glib/mm-network-timezone.h4
-rw-r--r--libmm-glib/mm-object.h4
-rw-r--r--libmm-glib/mm-sim.h4
-rw-r--r--libmm-glib/mm-simple-connect-properties.h4
-rw-r--r--libmm-glib/mm-simple-status.h4
-rw-r--r--libmm-glib/mm-sms-properties.h4
-rw-r--r--libmm-glib/mm-sms.h4
-rw-r--r--libmm-glib/mm-unlock-retries.h4
28 files changed, 109 insertions, 2 deletions
diff --git a/libmm-glib/Makefile.am b/libmm-glib/Makefile.am
index 4c46e466..df90997e 100644
--- a/libmm-glib/Makefile.am
+++ b/libmm-glib/Makefile.am
@@ -68,7 +68,8 @@ libmm_glib_la_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
-I${top_srcdir}/libmm-glib/generated \
- -I${top_builddir}/libmm-glib/generated
+ -I${top_builddir}/libmm-glib/generated \
+ -DLIBMM_GLIB_COMPILATION
libmm_glib_la_LIBADD = \
${top_builddir}/libmm-glib/generated/libmm-generated.la \
diff --git a/libmm-glib/libmm-glib.h b/libmm-glib/libmm-glib.h
index 62401bb6..ef4409aa 100644
--- a/libmm-glib/libmm-glib.h
+++ b/libmm-glib/libmm-glib.h
@@ -17,12 +17,14 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2011 Google, Inc.
+ * Copyright (C) 2011 - 2012 Google, Inc.
*/
#ifndef _LIBMM_GLIB_H_
#define _LIBMM_GLIB_H_
+#define __LIBMM_GLIB_H_INSIDE__
+
/* ModemManager generic headers */
#include <ModemManager.h>
diff --git a/libmm-glib/mm-bearer-ip-config.h b/libmm-glib/mm-bearer-ip-config.h
index 7fc6dd69..04b1da53 100644
--- a/libmm-glib/mm-bearer-ip-config.h
+++ b/libmm-glib/mm-bearer-ip-config.h
@@ -16,6 +16,10 @@
#ifndef MM_BEARER_IP_CONFIG_H
#define MM_BEARER_IP_CONFIG_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-bearer-properties.h b/libmm-glib/mm-bearer-properties.h
index 8272e6b6..74536d8d 100644
--- a/libmm-glib/mm-bearer-properties.h
+++ b/libmm-glib/mm-bearer-properties.h
@@ -19,6 +19,10 @@
#include <ModemManager.h>
#include <glib-object.h>
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
G_BEGIN_DECLS
#define MM_TYPE_BEARER_PROPERTIES (mm_bearer_properties_get_type ())
diff --git a/libmm-glib/mm-bearer.h b/libmm-glib/mm-bearer.h
index 4f90ae2a..dbaf497b 100644
--- a/libmm-glib/mm-bearer.h
+++ b/libmm-glib/mm-bearer.h
@@ -24,6 +24,10 @@
#ifndef _MM_BEARER_H_
#define _MM_BEARER_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-bearer.h"
diff --git a/libmm-glib/mm-common-helpers.h b/libmm-glib/mm-common-helpers.h
index 3d5657d8..eb631048 100644
--- a/libmm-glib/mm-common-helpers.h
+++ b/libmm-glib/mm-common-helpers.h
@@ -18,6 +18,10 @@
#include <glib.h>
#include <ModemManager-enums.h>
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#ifndef MM_COMMON_HELPERS_H
#define MM_COMMON_HELPERS_H
diff --git a/libmm-glib/mm-firmware-properties.h b/libmm-glib/mm-firmware-properties.h
index 83973443..f2375db6 100644
--- a/libmm-glib/mm-firmware-properties.h
+++ b/libmm-glib/mm-firmware-properties.h
@@ -16,6 +16,10 @@
#ifndef MM_FIRMWARE_PROPERTIES_H
#define MM_FIRMWARE_PROPERTIES_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-location-3gpp.h b/libmm-glib/mm-location-3gpp.h
index 41469c85..2318476f 100644
--- a/libmm-glib/mm-location-3gpp.h
+++ b/libmm-glib/mm-location-3gpp.h
@@ -16,6 +16,10 @@
#ifndef MM_LOCATION_3GPP_H
#define MM_LOCATION_3GPP_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-location-gps-nmea.h b/libmm-glib/mm-location-gps-nmea.h
index c5ebe42c..84f1dfdd 100644
--- a/libmm-glib/mm-location-gps-nmea.h
+++ b/libmm-glib/mm-location-gps-nmea.h
@@ -16,6 +16,10 @@
#ifndef MM_LOCATION_GPS_NMEA_H
#define MM_LOCATION_GPS_NMEA_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-location-gps-raw.h b/libmm-glib/mm-location-gps-raw.h
index 46f36580..f566f483 100644
--- a/libmm-glib/mm-location-gps-raw.h
+++ b/libmm-glib/mm-location-gps-raw.h
@@ -16,6 +16,10 @@
#ifndef MM_LOCATION_GPS_RAW_H
#define MM_LOCATION_GPS_RAW_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-manager.h b/libmm-glib/mm-manager.h
index f298c928..96c3066a 100644
--- a/libmm-glib/mm-manager.h
+++ b/libmm-glib/mm-manager.h
@@ -26,6 +26,10 @@
#ifndef _MM_MANAGER_H_
#define _MM_MANAGER_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem-3gpp-ussd.h b/libmm-glib/mm-modem-3gpp-ussd.h
index d05e7148..ee7522a8 100644
--- a/libmm-glib/mm-modem-3gpp-ussd.h
+++ b/libmm-glib/mm-modem-3gpp-ussd.h
@@ -24,6 +24,10 @@
#ifndef _MM_MODEM_3GPP_USSD_H_
#define _MM_MODEM_3GPP_USSD_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem-3gpp.h b/libmm-glib/mm-modem-3gpp.h
index e68d43d4..bb055dcd 100644
--- a/libmm-glib/mm-modem-3gpp.h
+++ b/libmm-glib/mm-modem-3gpp.h
@@ -24,6 +24,10 @@
#ifndef _MM_MODEM_3GPP_H_
#define _MM_MODEM_3GPP_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem-cdma.h b/libmm-glib/mm-modem-cdma.h
index b8aaa7dc..cb927d7e 100644
--- a/libmm-glib/mm-modem-cdma.h
+++ b/libmm-glib/mm-modem-cdma.h
@@ -24,6 +24,10 @@
#ifndef _MM_MODEM_CDMA_H_
#define _MM_MODEM_CDMA_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem-firmware.h b/libmm-glib/mm-modem-firmware.h
index e72e9206..fd8fbe8c 100644
--- a/libmm-glib/mm-modem-firmware.h
+++ b/libmm-glib/mm-modem-firmware.h
@@ -23,6 +23,10 @@
#ifndef _MM_MODEM_FIRMWARE_H_
#define _MM_MODEM_FIRMWARE_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem-location.h b/libmm-glib/mm-modem-location.h
index 86644763..7d033454 100644
--- a/libmm-glib/mm-modem-location.h
+++ b/libmm-glib/mm-modem-location.h
@@ -24,6 +24,10 @@
#ifndef _MM_MODEM_LOCATION_H_
#define _MM_MODEM_LOCATION_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem-messaging.h b/libmm-glib/mm-modem-messaging.h
index e911c005..0162a857 100644
--- a/libmm-glib/mm-modem-messaging.h
+++ b/libmm-glib/mm-modem-messaging.h
@@ -24,6 +24,10 @@
#ifndef _MM_MODEM_MESSAGING_H_
#define _MM_MODEM_MESSAGING_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem-simple.h b/libmm-glib/mm-modem-simple.h
index 83c2081e..0503a87f 100644
--- a/libmm-glib/mm-modem-simple.h
+++ b/libmm-glib/mm-modem-simple.h
@@ -24,6 +24,10 @@
#ifndef _MM_MODEM_SIMPLE_H_
#define _MM_MODEM_SIMPLE_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem-time.h b/libmm-glib/mm-modem-time.h
index 76f346f3..c0211792 100644
--- a/libmm-glib/mm-modem-time.h
+++ b/libmm-glib/mm-modem-time.h
@@ -24,6 +24,10 @@
#ifndef _MM_MODEM_TIME_H_
#define _MM_MODEM_TIME_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-modem.h b/libmm-glib/mm-modem.h
index 21436008..480c3fe4 100644
--- a/libmm-glib/mm-modem.h
+++ b/libmm-glib/mm-modem.h
@@ -24,6 +24,10 @@
#ifndef _MM_MODEM_H_
#define _MM_MODEM_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-network-timezone.h b/libmm-glib/mm-network-timezone.h
index 2c27fe00..42a1bc69 100644
--- a/libmm-glib/mm-network-timezone.h
+++ b/libmm-glib/mm-network-timezone.h
@@ -16,6 +16,10 @@
#ifndef MM_NETWORK_TIMEZONE_H
#define MM_NETWORK_TIMEZONE_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-object.h b/libmm-glib/mm-object.h
index 26f7c0b9..e2a758f5 100644
--- a/libmm-glib/mm-object.h
+++ b/libmm-glib/mm-object.h
@@ -24,6 +24,10 @@
#ifndef _MM_OBJECT_H_
#define _MM_OBJECT_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-modem.h"
diff --git a/libmm-glib/mm-sim.h b/libmm-glib/mm-sim.h
index 3743e728..1998bf6e 100644
--- a/libmm-glib/mm-sim.h
+++ b/libmm-glib/mm-sim.h
@@ -24,6 +24,10 @@
#ifndef _MM_SIM_H_
#define _MM_SIM_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-sim.h"
diff --git a/libmm-glib/mm-simple-connect-properties.h b/libmm-glib/mm-simple-connect-properties.h
index 2a2e72f0..7547aac3 100644
--- a/libmm-glib/mm-simple-connect-properties.h
+++ b/libmm-glib/mm-simple-connect-properties.h
@@ -16,6 +16,10 @@
#ifndef MM_SIMPLE_CONNECT_PROPERTIES_H
#define MM_SIMPLE_CONNECT_PROPERTIES_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-simple-status.h b/libmm-glib/mm-simple-status.h
index 884b6b95..fa535616 100644
--- a/libmm-glib/mm-simple-status.h
+++ b/libmm-glib/mm-simple-status.h
@@ -16,6 +16,10 @@
#ifndef MM_SIMPLE_STATUS_H
#define MM_SIMPLE_STATUS_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-sms-properties.h b/libmm-glib/mm-sms-properties.h
index dc944162..f02d641b 100644
--- a/libmm-glib/mm-sms-properties.h
+++ b/libmm-glib/mm-sms-properties.h
@@ -16,6 +16,10 @@
#ifndef MM_SMS_PROPERTIES_H
#define MM_SMS_PROPERTIES_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>
diff --git a/libmm-glib/mm-sms.h b/libmm-glib/mm-sms.h
index c90e1191..6cfb5b78 100644
--- a/libmm-glib/mm-sms.h
+++ b/libmm-glib/mm-sms.h
@@ -23,6 +23,10 @@
#ifndef _MM_SMS_H_
#define _MM_SMS_H_
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include "mm-gdbus-sms.h"
diff --git a/libmm-glib/mm-unlock-retries.h b/libmm-glib/mm-unlock-retries.h
index 48851b21..ea43cb6a 100644
--- a/libmm-glib/mm-unlock-retries.h
+++ b/libmm-glib/mm-unlock-retries.h
@@ -16,6 +16,10 @@
#ifndef MM_UNLOCK_RETRIES_H
#define MM_UNLOCK_RETRIES_H
+#if !defined (__LIBMM_GLIB_H_INSIDE__) && !defined (LIBMM_GLIB_COMPILATION)
+#error "Only <libmm-glib.h> can be included directly."
+#endif
+
#include <ModemManager.h>
#include <glib-object.h>