GNOME Bugzilla – Bug 620747
Fails to build without X gamma extension
Last modified: 2010-06-21 19:25:26 UTC
Gnome Screensaver refuses to compile if the X Gamma extension is not available (I forgot to install the header files beforehand, that's why I noticed): make all-am make[1]: Entering directory `/home/uws/Projects/Gnome/Development/src/gnome-screensaver/src' CC gs-fade.o gs-fade.c: In function ‘check_gamma_extension’: gs-fade.c:443: error: ‘screen_priv’ undeclared (first use in this function) gs-fade.c:443: error: (Each undeclared identifier is reported only once gs-fade.c:443: error: for each function it appears in.) make[1]: *** [gs-fade.o] Error 1 make[1]: Leaving directory `/home/uws/Projects/Gnome/Development/src/gnome-screensaver/src' make: *** [all] Error 2 This is due to the #ifdef guards not matching correctly: static void check_gamma_extension (GSFade *fade, int screen_idx) { #ifdef HAVE_XF86VMODE_GAMMA struct GSFadeScreenPrivate *screen_priv; [...] #endif screen_priv->fade_type = FADE_TYPE_NONE; }
Created attachment 162969 [details] [review] Bug 620747 — Fix build without X gamma extension Make sure the variable declarations are properly places inside the mess of #ifdefs, and cleanup the code for the X Gamma extension checks while we're at it: avoid a few gotos and conditionally define the functions that are only used if the Gamma extension is available (this avoids compiler warnings).
Committed a similar patch without the cleanups. Thanks.