SDL 1.3 cannot compile on FreeBSD 8 [SOLVED+Patch]

Hi all

SDL 1.3 current snapshot cannot compile on FreeBSD
8.1.

hg clone GitHub - libsdl-org/SDL: Simple Directmedia Layer

./configure --prefix=/usr
–includedir=/usr/include/sdl-1.3
–libdir=/usr/lib/sdl-1.3

gmake

libtool: compile:? gcc -g -O3 -I./include -mmmx
-msse
-fvisibility=hidden
-I/usr/local/include -DHAVE_USBHID_H -DUSBHID_NEW
-D_REENTRANT -D_THREAD_SAFE
-MMD -MT build/SDL_render_gl.lo -c
src/render/opengl/SDL_render_gl.c? -fPIC
-DPIC -o build/.libs/SDL_render_gl.o
In file included from
src/render/opengl/SDL_render_gl.c:27:
./include/SDL_opengl.h:5258: error: redefinition of
typedef
‘PFNGLCOLORTABLEPROC’
/usr/local/include/GL/gl.h:1739: error: previous
declaration of
‘PFNGLCOLORTABLEPROC’ was here

Best regards
Unga

./include/SDL_opengl.h describes:

“This file is included because glext.h is not available on
some systems.
If you don’t want this version included, simply define
::NO_SDL_GLEXT.”

I have glext.h, therefore, -DNO_SDL_GLEXT added, now no
redefinition error,
compilation goes further and hit following error:
src/video/x11/SDL_x11opengl.c: In function
‘X11_GL_GetSwapInterval’:
src/video/x11/SDL_x11opengl.c:575: error:
‘GLX_SWAP_INTERVAL_EXT’ undeclared (first use in this
function)

Following added to the src/video/x11/SDL_x11opengl.c:

#define GLX_SWAP_INTERVAL_EXT? ? ? ?
? ? ? 0x20F1

Compilation goes further and hit following error:
src/joystick/bsd/SDL_sysjoystick.c: In function
‘SDL_SYS_JoystickUpdate’:
src/joystick/bsd/SDL_sysjoystick.c:465: error:
dereferencing pointer to
incomplete type
src/joystick/bsd/SDL_sysjoystick.c:489: error:
dereferencing pointer to
incomplete type
src/joystick/bsd/SDL_sysjoystick.c:499: error:
dereferencing pointer to
incomplete type
src/joystick/bsd/SDL_sysjoystick.c:507: error:
dereferencing pointer to
incomplete type
src/joystick/bsd/SDL_sysjoystick.c: In function
‘report_alloc’:
src/joystick/bsd/SDL_sysjoystick.c:588: error:
dereferencing pointer to
incomplete type
src/joystick/bsd/SDL_sysjoystick.c:588: error:
dereferencing pointer to
incomplete type
gmake: *** [build/SDL_sysjoystick.lo] Error 1

Regards
Unga

Hi all

Attached patch solves the SDL 1.3 compilation issue on FreeBSD 8.1.

The patch for src/video/x11/SDL_x11opengl.c may require a better fix.

Best regards
Unga
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_1_3-FreeBSD8.patch
Type: application/octet-stream
Size: 1108 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110810/0c3e5743/attachment.obj— On Wed, 8/10/11, Unga <@Unga> wrote:

From: Unga <@Unga>
Subject: Re: [SDL] SDL 1.3 cannot compile on FreeBSD 8
To: “SDL Development List”
Date: Wednesday, August 10, 2011, 3:59 AM
— On Tue, 8/9/11, Unga <@Unga> wrote:

From: Unga <@Unga>
Subject: [SDL] SDL 1.3 cannot compile on FreeBSD 8
To: sdl at lists.libsdl.org
Date: Tuesday, August 9, 2011, 3:53 PM