Skip to content

Commit

Permalink
Don't expose X11 headers in user space any more (mostly).
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Albrecht Schlosser committed Mar 2, 2016
1 parent 39fdbec commit 35c4ae5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions FL/fl_utf8.h
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 35c4ae5

Please sign in to comment.