diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-03-05 21:21:42 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-03-05 21:25:38 +0100 |
commit | 6f55eb2e80f4948ad841d292c9f81c11620abcc6 (patch) | |
tree | 77c4c852f3a54688f3bc2e10b1a44faf311c4e62 /src | |
parent | bde2ccae927c98caf9b9428f59a4c86aea863139 (diff) |
Prevent inclusion of individual headers
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/libplanfahr.h | 4 | ||||
-rw-r--r-- | src/lpf-loc.h | 4 | ||||
-rw-r--r-- | src/lpf-manager.h | 4 | ||||
-rw-r--r-- | src/lpf-priv.h | 4 | ||||
-rw-r--r-- | src/lpf-provider.h | 4 | ||||
-rw-r--r-- | src/lpf-stop.h | 4 | ||||
-rw-r--r-- | src/lpf-trip-part.h | 4 | ||||
-rw-r--r-- | src/lpf-trip.h | 4 | ||||
-rw-r--r-- | src/providers/Makefile.am | 9 | ||||
-rw-r--r-- | src/providers/tests/Makefile.am | 9 |
11 files changed, 48 insertions, 5 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index c98bb93..41b86a4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -37,7 +37,8 @@ libplanfahr_0_0_la_SOURCES = \ libplanfahr_0_0_la_CFLAGS = \ -DG_LOG_DOMAIN="\"LibPlanFahr\"" \ - -DLPF_PROVIDERS_DIR="\"$(LPF_PROVIDERS_DIR)\"" \ + -DLIBPLANFAHR_COMPILATION \ + -DLPF_PROVIDERS_DIR="\"$(LPF_PROVIDERS_DIR)\"" \ -I$(top_srcdir) \ $(GIO2_CFLAGS) \ $(GOBJECT2_CFLAGS) \ diff --git a/src/libplanfahr.h b/src/libplanfahr.h index 518927a..37a6c42 100644 --- a/src/libplanfahr.h +++ b/src/libplanfahr.h @@ -23,6 +23,8 @@ #ifndef _LIBPLANFAHR #define _LIBPLANFAHR +#define __LIBPLANFAHR_H_INSIDE__ + #include "lpf-loc.h" #include "lpf-manager.h" #include "lpf-provider.h" @@ -30,4 +32,6 @@ #include "lpf-trip.h" #include "lpf-trip-part.h" +#undef __LIBPLANFAHR_H_INSIDE__ + #endif /* _LIBPLANFAHR */ diff --git a/src/lpf-loc.h b/src/lpf-loc.h index ae68a33..7dc8209 100644 --- a/src/lpf-loc.h +++ b/src/lpf-loc.h @@ -23,6 +23,10 @@ #ifndef _LPF_LOC_H #define _LPF_LOC_H +#if !defined (__LIBPLANFAHR_H_INSIDE__) && !defined (LIBPLANFAHR_COMPILATION) +# error "Only <libplanfahr.h> can be included directly." +#endif + #include <glib-object.h> G_BEGIN_DECLS diff --git a/src/lpf-manager.h b/src/lpf-manager.h index 323f9d2..e1bef71 100644 --- a/src/lpf-manager.h +++ b/src/lpf-manager.h @@ -23,6 +23,10 @@ #ifndef _LPF_MANAGER_H #define _LPF_MANAGER_H +#if !defined (__LIBPLANFAHR_H_INSIDE__) && !defined (LIBPLANFAHR_COMPILATION) +# error "Only <libplanfahr.h> can be included directly." +#endif + #include <glib-object.h> #include "lpf-provider.h" diff --git a/src/lpf-priv.h b/src/lpf-priv.h index c84180a..7b1008d 100644 --- a/src/lpf-priv.h +++ b/src/lpf-priv.h @@ -23,6 +23,10 @@ #ifndef _LPF_PRIV_H #define _LPF_PRIV_H +#if !defined (LIBPLANFAHR_COMPILATION) +# error "Only <libplanfahr.h> can be included directly." +#endif + #include <config.h> #ifdef ENABLE_DEBUG diff --git a/src/lpf-provider.h b/src/lpf-provider.h index aa810f9..e54f612 100644 --- a/src/lpf-provider.h +++ b/src/lpf-provider.h @@ -19,6 +19,10 @@ #ifndef _LPF_PROVIDER #define _LPF_PROVIDER +#if !defined (__LIBPLANFAHR_H_INSIDE__) && !defined (LIBPLANFAHR_COMPILATION) +# error "Only <libplanfahr.h> can be included directly." +#endif + #include <glib-object.h> #include <lpf-loc.h> diff --git a/src/lpf-stop.h b/src/lpf-stop.h index c7a3bbf..aaebb38 100644 --- a/src/lpf-stop.h +++ b/src/lpf-stop.h @@ -23,6 +23,10 @@ #ifndef _LPF_STOP_H #define _LPF_STOP_H +#if !defined (__LIBPLANFAHR_H_INSIDE__) && !defined (LIBPLANFAHR_COMPILATION) +# error "Only <libplanfahr.h> can be included directly." +#endif + #include <glib-object.h> G_BEGIN_DECLS diff --git a/src/lpf-trip-part.h b/src/lpf-trip-part.h index f514bf6..57be140 100644 --- a/src/lpf-trip-part.h +++ b/src/lpf-trip-part.h @@ -23,6 +23,10 @@ #ifndef _LPF_TRIP_PART_H #define _LPF_TRIP_PART_H +#if !defined (__LIBPLANFAHR_H_INSIDE__) && !defined (LIBPLANFAHR_COMPILATION) +# error "Only <libplanfahr.h> can be included directly." +#endif + #include <glib-object.h> G_BEGIN_DECLS diff --git a/src/lpf-trip.h b/src/lpf-trip.h index d0f1542..3f2af42 100644 --- a/src/lpf-trip.h +++ b/src/lpf-trip.h @@ -23,6 +23,10 @@ #ifndef _LPF_TRIP_H #define _LPF_TRIP_H +#if !defined (__LIBPLANFAHR_H_INSIDE__) && !defined (LIBPLANFAHR_COMPILATION) +# error "Only <libplanfahr.h> can be included directly." +#endif + #include <glib-object.h> G_BEGIN_DECLS diff --git a/src/providers/Makefile.am b/src/providers/Makefile.am index 0f1ee3c..e4f8757 100644 --- a/src/providers/Makefile.am +++ b/src/providers/Makefile.am @@ -4,6 +4,12 @@ SUBDIRS = tests pkglibdir = $(LPF_PROVIDERS_DIR) +AM_CPPFLAGS = \ + -DG_LOG_DOMAIN="\"LibPlanFahr\"" \ + -DLIBPLANFAHR_COMPILATION \ + -DLPF_PROVIDERS_DIR="\"$(LPF_PROVIDERS_DIR)\"" \ + $(NULL) + pkglib_LTLIBRARIES = \ libplanfahr-provider-ch-sbb.la \ libplanfahr-provider-de-db.la \ @@ -18,6 +24,7 @@ libplanfahr_provider_ch_sbb_la_SOURCES = \ $(NULL) libplanfahr_provider_ch_sbb_la_CFLAGS = \ + $(AM_CPPFLAGS) \ $(GIO2_CFLAGS) \ $(GOBJECT2_CFLAGS) \ $(GTHREAD2_CFLAGS) \ @@ -41,6 +48,7 @@ libplanfahr_provider_de_db_la_SOURCES = \ $(NULL) libplanfahr_provider_de_db_la_CFLAGS = \ + $(AM_CPPFLAGS) \ $(GIO2_CFLAGS) \ $(GOBJECT2_CFLAGS) \ $(GTHREAD2_CFLAGS) \ @@ -64,6 +72,7 @@ libplanfahr_provider_de_bvg_la_SOURCES = \ $(NULL) libplanfahr_provider_de_bvg_la_CFLAGS = \ + $(AM_CPPFLAGS) \ $(GIO2_CFLAGS) \ $(GOBJECT2_CFLAGS) \ $(GTHREAD2_CFLAGS) \ diff --git a/src/providers/tests/Makefile.am b/src/providers/tests/Makefile.am index 764c17a..2b4ce47 100644 --- a/src/providers/tests/Makefile.am +++ b/src/providers/tests/Makefile.am @@ -2,7 +2,9 @@ include $(top_srcdir)/flymake.mk check_PROGRAMS = hafas-bin6 hafas-bin6-format -AM_CFLAGS = \ +AM_CPPFLAGS = \ + -DLIBPLANFAHR_COMPILATION \ + -DLPF_TEST_SRCDIR=\""$(abs_srcdir)"\" \ $(GLIB2_CFLAGS) \ $(GIO2_CFLAGS) \ $(GOBJECT2_CFLAGS) \ @@ -10,7 +12,6 @@ AM_CFLAGS = \ $(LIBXML2_CFLAGS) \ $(WARN_CFLAGS) \ -I$(top_srcdir)/src \ - -DLPF_TEST_SRCDIR=\""$(abs_srcdir)"\" \ $(NULL) LDADD = \ @@ -26,7 +27,7 @@ hafas_bin6_SOURCES = \ $(NULL) hafas_bin6_CFLAGS = \ - $(AM_CFLAGS) \ + $(AM_CPPFLAGS) \ $(LIBSOUP_CFLAGS) \ $(LIBXML2_CFLAGS) \ $(NULL) @@ -42,7 +43,7 @@ hafas_bin6_format_SOURCES = \ ../hafas-bin6-format.h \ $(NULL) hafas_bin6_format_CFLAGS = \ - $(AM_CFLAGS) \ + $(AM_CPPFLAGS) \ $(NULL) hafas_bin6_format_LDADD = \ $(LDADD) \ |