Including Xutil.h on Fedora breaks BOOST_FOREACH
Compiling this:
#include
Tron Thomas wrote:
#include
A quick search on Google Codesearch shows that Xutil.h includes Xlib.h which has the following " #define Bool int #define Status int #define True 1 #define False 0 " (around line 112 in the version I am looking at). This breaks Boost.ForEach's (legitimate) attempt to use "Bool" as the name for a template type. How to fix? Some possibilities a) Stop using libraries that employ such bad practices, or b) Wrap the include in your own header that tidies up after X11 with some #undefs, or c) include X11 after Boost ?! I doubt Boost.ForEach would be the only library the X11 include would foul up.
Pete Bartlett wrote:
Tron Thomas wrote:
#include
A quick search on Google Codesearch shows that Xutil.h includes Xlib.h which has the following
" #define Bool int #define Status int #define True 1 #define False 0 "
(around line 112 in the version I am looking at).
This breaks Boost.ForEach's (legitimate) attempt to use "Bool" as the name for a template type. How to fix? Some possibilities
a) Stop using libraries that employ such bad practices, or b) Wrap the include in your own header that tidies up after X11 with some #undefs, or c) include X11 after Boost ?!
d) Work around it in Boost.Foreach, which has already been done for the next release.
I doubt Boost.ForEach would be the only library the X11 include would foul up.
Perhaps someone with an interest in X11 could file a bug against them. -- Eric Niebler BoostPro Computing http://www.boostpro.com
participants (3)
-
Eric Niebler
-
Pete Bartlett
-
Tron Thomas