[gtksourceview] enumtypes: warn when #included in external code



commit d56d8cff8043fbd6b34460548fb3a4103b0a43f3
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Jun 25 12:47:12 2016 +0200

    enumtypes: warn when #included in external code

 gtksourceview/Makefile.am |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/Makefile.am b/gtksourceview/Makefile.am
index eb59658..29f3dcf 100644
--- a/gtksourceview/Makefile.am
+++ b/gtksourceview/Makefile.am
@@ -234,6 +234,13 @@ stamp-gtksourceview-enumtypes.h: Makefile.am $(libgtksourceview_public_headers)
         && $(GLIB_MKENUMS) \
                        --fhead "#ifndef GTKSOURCEVIEW_ENUMTYPES_H\n" \
                        --fhead "#define GTKSOURCEVIEW_ENUMTYPES_H\n\n" \
+                       --fhead "#if !defined (GTK_SOURCE_H_INSIDE) && !defined (GTK_SOURCE_COMPILATION)\n" \
+                       --fhead "#  if defined (__GNUC__)\n" \
+                       --fhead "#    warning \"Only <gtksourceview/gtksource.h> can be included 
directly.\"\n" \
+                       --fhead "#  elif defined (G_OS_WIN32)\n" \
+                       --fhead "#    pragma message(\"Only <gtksourceview/gtksource.h> can be included 
directly.\")\n" \
+                       --fhead "#  endif\n" \
+                       --fhead "#endif\n\n" \
                        --ftail "#endif /* GTKSOURCEVIEW_ENUMTYPES_H */\n" \
                        --fprod "#include <gtksourceview/@filename@>\n" \
                        --eprod "G_BEGIN_DECLS\n" \


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