[gspell] Allow only gspell.h to be included directly



commit 3752fd7822bac35d9c435129f099cf35dc2d5a6b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Nov 21 14:34:42 2015 +0100

    Allow only gspell.h to be included directly
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757844

 gspell/Makefile.am                      |    1 +
 gspell/gspell-checker-dialog.h          |    4 ++++
 gspell/gspell-checker.h                 |    4 ++++
 gspell/gspell-inline-checker-gtv.h      |    4 ++++
 gspell/gspell-language-chooser-button.h |    4 ++++
 gspell/gspell-language-chooser-dialog.h |    4 ++++
 gspell/gspell-language-chooser.h        |    4 ++++
 gspell/gspell-language.h                |    4 ++++
 gspell/gspell-navigator-gtv.h           |    4 ++++
 gspell/gspell-navigator.h               |    4 ++++
 gspell/gspell.h                         |    4 ++++
 11 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/gspell/Makefile.am b/gspell/Makefile.am
index d53cfe0..85a18b4 100644
--- a/gspell/Makefile.am
+++ b/gspell/Makefile.am
@@ -3,6 +3,7 @@ SUBDIRS = resources
 AM_CPPFLAGS =                          \
        -DDATADIR=\""$(datadir)"\"      \
        -DG_LOG_DOMAIN=\"gspell\"       \
+       -DGSPELL_COMPILATION            \
        -I$(top_builddir)               \
        -I$(top_srcdir)                 \
        $(WARN_CFLAGS)                  \
diff --git a/gspell/gspell-checker-dialog.h b/gspell/gspell-checker-dialog.h
index e40cfd8..e151c3f 100644
--- a/gspell/gspell-checker-dialog.h
+++ b/gspell/gspell-checker-dialog.h
@@ -21,6 +21,10 @@
 #ifndef __GSPELL_CHECKER_DIALOG_H__
 #define __GSPELL_CHECKER_DIALOG_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <gtk/gtk.h>
 #include <gspell/gspell-navigator.h>
 
diff --git a/gspell/gspell-checker.h b/gspell/gspell-checker.h
index 3abc739..b1534f2 100644
--- a/gspell/gspell-checker.h
+++ b/gspell/gspell-checker.h
@@ -21,6 +21,10 @@
 #ifndef __GSPELL_CHECKER_H__
 #define __GSPELL_CHECKER_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <glib-object.h>
 #include <gspell/gspell-language.h>
 
diff --git a/gspell/gspell-inline-checker-gtv.h b/gspell/gspell-inline-checker-gtv.h
index beeaf87..b884fe6 100644
--- a/gspell/gspell-inline-checker-gtv.h
+++ b/gspell/gspell-inline-checker-gtv.h
@@ -25,6 +25,10 @@
 #ifndef __GSPELL_INLINE_CHECKER_GTV_H__
 #define __GSPELL_INLINE_CHECKER_GTV_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <gtksourceview/gtksource.h>
 #include <gspell/gspell-checker.h>
 
diff --git a/gspell/gspell-language-chooser-button.h b/gspell/gspell-language-chooser-button.h
index 8a8f3cf..d2e53f2 100644
--- a/gspell/gspell-language-chooser-button.h
+++ b/gspell/gspell-language-chooser-button.h
@@ -20,6 +20,10 @@
 #ifndef __GSPELL_LANGUAGE_CHOOSER_BUTTON_H__
 #define __GSPELL_LANGUAGE_CHOOSER_BUTTON_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <gtk/gtk.h>
 #include <gspell/gspell-language.h>
 
diff --git a/gspell/gspell-language-chooser-dialog.h b/gspell/gspell-language-chooser-dialog.h
index 62effc3..662b5d4 100644
--- a/gspell/gspell-language-chooser-dialog.h
+++ b/gspell/gspell-language-chooser-dialog.h
@@ -21,6 +21,10 @@
 #ifndef __GSPELL_LANGUAGE_CHOOSER_DIALOG_H__
 #define __GSPELL_LANGUAGE_CHOOSER_DIALOG_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <gtk/gtk.h>
 #include <gspell/gspell-language.h>
 
diff --git a/gspell/gspell-language-chooser.h b/gspell/gspell-language-chooser.h
index 9caa369..fc4a748 100644
--- a/gspell/gspell-language-chooser.h
+++ b/gspell/gspell-language-chooser.h
@@ -20,6 +20,10 @@
 #ifndef __GSPELL_LANGUAGE_CHOOSER_H__
 #define __GSPELL_LANGUAGE_CHOOSER_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <glib-object.h>
 #include <gspell/gspell-language.h>
 
diff --git a/gspell/gspell-language.h b/gspell/gspell-language.h
index 3590367..93c21a8 100644
--- a/gspell/gspell-language.h
+++ b/gspell/gspell-language.h
@@ -21,6 +21,10 @@
 #ifndef __GSPELL_LANGUAGE_H__
 #define __GSPELL_LANGUAGE_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <glib-object.h>
 
 G_BEGIN_DECLS
diff --git a/gspell/gspell-navigator-gtv.h b/gspell/gspell-navigator-gtv.h
index 440f0c1..26a7366 100644
--- a/gspell/gspell-navigator-gtv.h
+++ b/gspell/gspell-navigator-gtv.h
@@ -20,6 +20,10 @@
 #ifndef __GSPELL_NAVIGATOR_GTV_H__
 #define __GSPELL_NAVIGATOR_GTV_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <gtk/gtk.h>
 #include <gspell/gspell-navigator.h>
 #include <gspell/gspell-checker.h>
diff --git a/gspell/gspell-navigator.h b/gspell/gspell-navigator.h
index 930f51e..196c733 100644
--- a/gspell/gspell-navigator.h
+++ b/gspell/gspell-navigator.h
@@ -20,6 +20,10 @@
 #ifndef __GSPELL_NAVIGATOR_H__
 #define __GSPELL_NAVIGATOR_H__
 
+#if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
+#error "Only <gspell/gspell.h> can be included directly."
+#endif
+
 #include <glib-object.h>
 #include <gspell/gspell-checker.h>
 
diff --git a/gspell/gspell.h b/gspell/gspell.h
index 1909289..2091c9d 100644
--- a/gspell/gspell.h
+++ b/gspell/gspell.h
@@ -20,6 +20,8 @@
 #ifndef __GSPELL_H__
 #define __GSPELL_H__
 
+#define __GSPELL_H_INSIDE__
+
 #include <gspell/gspell-checker.h>
 #include <gspell/gspell-checker-dialog.h>
 #include <gspell/gspell-inline-checker-gtv.h>
@@ -30,6 +32,8 @@
 #include <gspell/gspell-navigator.h>
 #include <gspell/gspell-navigator-gtv.h>
 
+#undef __GSPELL_H_INSIDE__
+
 #endif /* __GSPELL_H__ */
 
 /* ex:set ts=8 noet: */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]