[AD] Bugfix if ALLEGRO_XWINDOWS_WITH_XCURSOR isn't defined by ./configure

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi,

I got this error when compiling Allegro 4.2.0beta:

gcc -DHAVE_CONFIG_H -I. -Iinclude -Iinclude/allegro -I./include
-I./include/allegro -I/usr/X11R6/include  -DALLEGRO_LIB_BUILD 
-mcpu=pentium -O2 -funroll-loops -ffast-math -fomit-frame-pointer
-Wall -Wno-unused  -fPIC -DALLEGRO_SHARED -c ./src/x/xwin.c -o
obj/unix/shared/alleg/xwin.o
src/x/xwin.c: In function `_xwin_hide_x_mouse':
src/x/xwin.c:341: error: structure has no member named `xcursor_image'
src/x/xwin.c:342: warning: implicit declaration of function
`XcursorImageDestroy'
src/x/xwin.c:342: error: structure has no member named `xcursor_image'
src/x/xwin.c:343: error: structure has no member named `xcursor_image'
make: *** [obj/unix/shared/alleg/xwin.o] Error 1

./configure said:
checking for XcursorImageCreate in -lXcursor... no
I supposed this had something to do with it.

So I fixed the problem by adding a #ifdef
ALLEGRO_XWINDOWS_WITH_XCURSOR ... #endif block in x/xwin.c. Patch
attached.

Tobi Vollebregt,
tobivollebregt@xxxxxxxxxx
--- src/x/xwin.c	Mon Mar 28 12:36:36 2005 UTC
+++ src/x/xwin.c	Sun Apr 17 11:57:43 2005 UTC
@@ -338,10 +338,12 @@
       _xwin.cursor = None;
    }
 
+#ifdef ALLEGRO_XWINDOWS_WITH_XCURSOR
    if (_xwin.xcursor_image != None) {
       XcursorImageDestroy(_xwin.xcursor_image);
       _xwin.xcursor_image = None;
    }
+#endif /* defined(ALLEGRO_XWINDOWS_WITH_XCURSOR) */
 
    pixmap = XCreatePixmap(_xwin.display, _xwin.window, 1, 1, 1);
    if (pixmap != None) {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/