summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2016-03-02 12:40:53 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2016-03-02 12:40:53 +0000
commit35c4ae55274f894bf5e95056975be7876e08e1f3 (patch)
tree97f9f7314c6fa7bd8b9aafb27ca8cbb533d9417a
parent39fdbecd1656ad10f76fe994824001ef94355ad4 (diff)
Don't expose X11 headers in user space any more (mostly).
Platform headers should not be #include'd in public FLTK header files, so that user space is not polluted by platform specific definitions. See discussion and test file in discussion in fltk.general: https://groups.google.com/forum/#!topic/fltkgeneral/gzmdRk2LvAk https://groups.google.com/d/msg/fltkgeneral/gzmdRk2LvAk/EOe314ChBgAJ This commit fixes FL/fl_utf8.h to #include X11 headers only if compiled in the FLTK library (same as in FLTK 1.3.4, svn r 11266). Todo (FLTK 1.4): Remove more unnecessary (unwanted) system header #include statements from FL/x.H and other public header files. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11268 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/fl_utf8.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h
index b8247f006..fe23fe93f 100644
--- a/FL/fl_utf8.h
+++ b/FL/fl_utf8.h
@@ -35,6 +35,13 @@
#include <string.h>
#include <stdlib.h>
+/*
+ *FIXME* -- PORTME: should not be in the header --
+ Many, if not all of the included headers below should not be included
+ here, because this pollutes user space definitions.
+ Note: FL/fl_utf8.h is included in many other header files!
+*/
+
#ifdef WIN32
# include <sys/types.h>
# include <sys/stat.h>
@@ -67,8 +74,10 @@
#else /* X11 */
# include <sys/types.h>
# include <sys/stat.h>
-# include <X11/Xlocale.h>
-# include <X11/Xlib.h>
+# if defined(FL_LIBRARY) /* don't expose X11 headers in user space */
+# include <X11/Xlocale.h>
+# include <X11/Xlib.h>
+# endif /* defined(FL_LIBRARY) -- don't expose X11 headers in user space */
# include <locale.h>
# define xchar unsigned short
#endif