#148 X11 freeglut build break (with patch)

closed-fixed
nobody
None
5
2011-09-04
2011-04-23
No

Recent changes to freeglut_gamemode.c make use of SFG_Display::DisplayPointerX and SFG_Display::DisplayPointerY.
However, in freeglut_internal.h these are only available when HAVE_X11_EXTENSIONS_XF86VMODE_H is defined.
For whatever reason, that wasn't defined when I built on Ubuntu 10.10 x86.

/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -pedantic -MT libglut_la-freeglut_gamemode.lo -MD -MP -MF .deps/libglut_la-freeglut_gamemode.Tpo -c -o libglut_la-freeglut_gamemode.lo `test -f 'freeglut_gamemode.c' || echo './'`freeglut_gamemode.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -pedantic -MT libglut_la-freeglut_gamemode.lo -MD -MP -MF .deps/libglut_la-freeglut_gamemode.Tpo -c freeglut_gamemode.c -fPIC -DPIC -o .libs/libglut_la-freeglut_gamemode.o
freeglut_gamemode.c: In function ‘fghRememberState’:
freeglut_gamemode.c:178: error: ‘SFG_Display’ has no member named ‘DisplayPointerX’
freeglut_gamemode.c:178: error: ‘SFG_Display’ has no member named ‘DisplayPointerY’
freeglut_gamemode.c:179: error: ‘SFG_Display’ has no member named ‘DisplayPointerX’
freeglut_gamemode.c:179: error: ‘SFG_Display’ has no member named ‘DisplayPointerY’
freeglut_gamemode.c: In function ‘fghRestoreState’:
freeglut_gamemode.c:271: error: ‘SFG_Display’ has no member named ‘DisplayPointerX’
freeglut_gamemode.c:271: error: ‘SFG_Display’ has no member named ‘DisplayPointerY’
make[2]: *** [libglut_la-freeglut_gamemode.lo] Error 1
make[2]: Leaving directory `/home/nigels/SourceForge/freeglut/trunk/freeglut/freeglut/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/nigels/SourceForge/freeglut/trunk/freeglut/freeglut'
make: *** [all] Error 2

The following patch scopes SFG_Display::DisplayPointerX and SFG_Display::DisplayPointerY to the TARGET_HOST_POSIX_X11 scope, rather than HAVE_X11_EXTENSIONS_XF86VMODE_H. And the build succeeds.

Index: src/freeglut_internal.h

--- src/freeglut_internal.h (revision 915)
+++ src/freeglut_internal.h (working copy)
@@ -379,11 +379,11 @@
int DisplayModeClock; /* The display mode's refresh rate */
int DisplayViewPortX; /* saved X location of the viewport */
int DisplayViewPortY; /* saved Y location of the viewport */
+#endif /* HAVE_X11_EXTENSIONS_XF86VMODE_H */
+
int DisplayPointerX; /* saved X location of the pointer */
int DisplayPointerY; /* saved Y location of the pointer */

-#endif /* HAVE_X11_EXTENSIONS_XF86VMODE_H */
-
#elif TARGET_HOST_MS_WINDOWS
HINSTANCE Instance; /* The application's instance */
DEVMODE DisplayMode; /* Desktop's display settings */

Discussion

  • Nigel Stewart

    Nigel Stewart - 2011-04-23

    SFG_Display::DisplayPointerX and SFG_Display::DisplayPointerY to the TARGET_HOST_POSIX_X11 scope, rather than HAVE_X11_EXTENSIONS_XF86VMODE_H

     
  • John F. Fay

    John F. Fay - 2011-09-04

    Fixed in version 927. Nigel, if you're still here, please test this to see if I got it right.

    - John

     
  • John F. Fay

    John F. Fay - 2011-09-04
    • status: open --> closed-fixed
     

Log in to post a comment.