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
This commit is contained in:
Albrecht Schlosser
2016-03-02 12:40:53 +00:00
parent 39fdbecd16
commit 35c4ae5527
+11 -2
View File
@@ -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