<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Software is Crap]]></provider_name><provider_url><![CDATA[https://davmac.wordpress.com]]></provider_url><author_name><![CDATA[davmac]]></author_name><author_url><![CDATA[https://davmac.wordpress.com/author/davmac/]]></author_url><title><![CDATA[Compiz, X11, Glib, and general&nbsp;stupidity]]></title><type><![CDATA[link]]></type><html><![CDATA[<p><strong>Edit/Disclaimer:</strong><em> I must have been having a bad day when I originally wrote this. There&#8217;s some very questionable development practice discussed here but calling people (even and perhaps especially non-specific people) &#8220;jerks&#8221; was going too far. Apologies to anyone I offended with this post.</em></p>
<p>I&#8217;m currently in the process of trying to compile <strong>compiz</strong>, the compositor/window manager for X that&#8217;s been around for a long time now under various different names. The first snag I hit was that compiz isn&#8217;t housed where you might think, that is, the <a href="http://www.compiz.org/">compiz website</a>; instead it seems recent versions can be found <a href="https://launchpad.net/compiz">in launchpad</a>, where presumably various folks from Ubuntu have had their way with it. In any case, I&#8217;ve downloaded the source for version 0.9.12 from launchpad. On trying to build it (with &#8220;make VERBOSE=1&#8221;) I&#8217;m seeing this error:</p>
<pre style="padding-left:30px;">[ 11%] Building CXX object src/CMakeFiles/compiz_core.dir/eventsource.cpp.o
cd /usr/src/compiz-0.9.12.0/build/src &amp;&amp; /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_SCANDIR_POSIX -Dcompiz_core_EXPORTS -fPIC -Wall -Wno-unused-private-field -Wno-unused-local-typedefs -Wno-deprecated-declarations -Werror -fPIC -Wall -Wno-unused-private-field -Wno-unused-local-typedefs -Wno-deprecated-declarations -Werror -fPIC -Wall -Wno-unused-private-field -Wno-unused-local-typedefs -Wno-deprecated-declarations -Werror -O2 -g -DNDEBUG -fPIC -I/usr/src/compiz-0.9.12.0/include -I/usr/src/compiz-0.9.12.0/build -I/usr/src/compiz-0.9.12.0/build/generated -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/startup-notification-1.0 -I/usr/X11R7/include -I/include -I/usr/src/compiz-0.9.12.0/src -I/usr/src/compiz-0.9.12.0/src/string/include -I/usr/src/compiz-0.9.12.0/src/string/src -I/usr/src/compiz-0.9.12.0/src/logmessage/include -I/usr/src/compiz-0.9.12.0/src/logmessage/src -I/usr/src/compiz-0.9.12.0/src/timer/include -I/usr/src/compiz-0.9.12.0/src/timer/src -I/usr/src/compiz-0.9.12.0/src/pluginclasshandler/include -I/usr/src/compiz-0.9.12.0/src/pluginclasshandler/src -I/usr/src/compiz-0.9.12.0/src/point/include -I/usr/src/compiz-0.9.12.0/src/point/src -I/usr/src/compiz-0.9.12.0/src/rect/include -I/usr/src/compiz-0.9.12.0/src/rect/src -I/usr/src/compiz-0.9.12.0/src/servergrab/include -I/usr/src/compiz-0.9.12.0/src/servergrab/src -I/usr/src/compiz-0.9.12.0/src/region/include -I/usr/src/compiz-0.9.12.0/src/region/src -I/usr/src/compiz-0.9.12.0/src/window/geometry/include -I/usr/src/compiz-0.9.12.0/src/window/geometry/src -I/usr/src/compiz-0.9.12.0/src/window/geometry-saver/include -I/usr/src/compiz-0.9.12.0/src/window/geometry-saver/src -I/usr/src/compiz-0.9.12.0/src/window/extents/include -I/usr/src/compiz-0.9.12.0/src/window/extents/src -I/usr/src/compiz-0.9.12.0/src/window/constrainment/include -I/usr/src/compiz-0.9.12.0/src/window/constrainment/src    -DPLUGINDIR=\"/usr/lib/compiz\" -DSHAREDIR=\"/usr/share/compiz/\" -DMETADATADIR=\"/usr/share/compiz\" -o CMakeFiles/compiz_core.dir/eventsource.cpp.o -c /usr/src/compiz-0.9.12.0/src/eventsource.cpp
In file included from /usr/src/compiz-0.9.12.0/include/core/window.h:35:0,
                 from /usr/src/compiz-0.9.12.0/include/core/screen.h:31,
                 from /usr/src/compiz-0.9.12.0/src/eventsource.cpp:28:
/usr/X11R7/include/X11/Xregion.h:59:0: error: "TRUE" redefined [-Werror]
 #define TRUE 1
 ^
In file included from /usr/lib/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glibmm-2.4/glibmm/timeval.h:26,
                 from /usr/include/glibmm-2.4/glibmm/main.h:24,
                 from /usr/src/compiz-0.9.12.0/src/privateeventsource.h:30,
                 from /usr/src/compiz-0.9.12.0/src/eventsource.cpp:27:
/usr/include/glib-2.0/glib/gmacros.h:233:0: note: this is the location of the previous definition
 #define TRUE (!FALSE)
 ^
In file included from /usr/src/compiz-0.9.12.0/include/core/window.h:35:0,
                 from /usr/src/compiz-0.9.12.0/include/core/screen.h:31,
                 from /usr/src/compiz-0.9.12.0/src/eventsource.cpp:28:
/usr/X11R7/include/X11/Xregion.h:60:0: error: "FALSE" redefined [-Werror]
 #define FALSE 0
 ^
In file included from /usr/lib/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glibmm-2.4/glibmm/timeval.h:26,
                 from /usr/include/glibmm-2.4/glibmm/main.h:24,
                 from /usr/src/compiz-0.9.12.0/src/privateeventsource.h:30,
                 from /usr/src/compiz-0.9.12.0/src/eventsource.cpp:27:
/usr/include/glib-2.0/glib/gmacros.h:229:0: note: this is the location of the previous definition
 #define FALSE (0)
 ^
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: error: unrecognized command line option "-Wno-unused-private-field" [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/compiz_core.dir/eventsource.cpp.o] Error 1
make[2]: Leaving directory `/usr/src/compiz-0.9.12.0/build'
make[1]: *** [src/CMakeFiles/compiz_core.dir/all] Error 2
make[1]: Leaving directory `/usr/src/compiz-0.9.12.0/build'
make: *** [all] Error 2</pre>
<p>I am astounded; it seems there are three separate packages in which the maintainers have displayed astonishing levels of ignorance and arrogance. First, and most obviously:</p>
<p style="padding-left:30px;"><em>Compiz have released a source bundle which doesn&#8217;t build.</em></p>
<p>Oh, I&#8217;m sure it builds on some system with modified headers, as perhaps might be found on Ubuntu systems or others, but it doesn&#8217;t build against vanilla versions of the packages on which it depends &#8211; in this case libX11 and Glib, both fairly fundamental libraries (I have the most recent released versions of both).</p>
<p>As bad as this, however, it pales in comparison with the bone-headedness of the developers of those packages, who have both chosen to define constants, in the global namespace, called <em>TRUE</em> and <em>FALSE</em>.</p>
<p>Here&#8217;s a hint, you jerks:</p>
<p style="padding-left:30px;"><em>Don&#8217;t do that</em>.</p>
<p>I&#8217;m thinking that to work around this, I&#8217;ll just add &#8220;#undef TRUE&#8221; and &#8220;#undef FALSE&#8221; before the inclusion of <em>Xregion.h</em> (i.e. in compiz&#8217;s <em>core/window.h</em>). But it&#8217;s really a huge problem that they&#8217;re defined in the first place. Macros in the global namespace are bad enough without giving them such generic names as TRUE and FALSE.</p>
<p><em>Update</em>: I&#8217;m not certain but it looks like compiz might be using Xlib internal API by including the Xregion.h header, which is not a documented header; this puts the blame mostly on compiz if correct. Essentially it seems that Xregion.h provides the implementation for the public region operations which are defined in Xutil.h (in particular, &#8216;struct _Xregion&#8217; is defined in Xregion.h, but is an opaque structure in Xutil.h). See documentation for region manipulation <a href="http://tronche.com/gui/x/xlib/utilities/regions/">here</a>.</p>
]]></html></oembed>