Fixed a few issues compiling with Mac OS X 10.6
authorSam Lantinga <slouken@libsdl.org>
Sat, 05 Sep 2009 07:33:54 +0000
changeset 324108c5964f2a34
parent 3240 6c4736b446e8
child 3242 af4a5af3cd2b
Fixed a few issues compiling with Mac OS X 10.6

Unfortunately the audio and cdrom systems do not build at all, and if you
disable those, SDL still fails to link with these errors:

Undefined symbols:
"_OBJC_IVAR_$_NSScreen._frame", referenced from:
-[NSScreen(NSScreenAccess) setFrame:] in SDL_cocoamodes.o
"_KLGetKeyboardLayoutProperty", referenced from:
_UpdateKeymap in SDL_cocoakeyboard.o
_UpdateKeymap in SDL_cocoakeyboard.o
"_KLGetCurrentKeyboardLayout", referenced from:
_UpdateKeymap in SDL_cocoakeyboard.o
ld: symbol(s) not found
include/SDL_opengl.h
src/video/x11/SDL_x11events.c
src/video/x11/SDL_x11opengl.c
src/video/x11/SDL_x11window.c
     1.1 --- a/include/SDL_opengl.h	Sat Sep 05 07:13:01 2009 +0000
     1.2 +++ b/include/SDL_opengl.h	Sat Sep 05 07:33:54 2009 +0000
     1.3 @@ -22,6 +22,9 @@
     1.4  
     1.5  /* This is a simple file to encapsulate the OpenGL API headers */
     1.6  
     1.7 +#ifndef _SDL_opengl_h
     1.8 +#define _SDL_opengl_h
     1.9 +
    1.10  #include "SDL_config.h"
    1.11  
    1.12  #ifdef __WIN32__
    1.13 @@ -37,6 +40,7 @@
    1.14  #if defined(__MACOSX__)
    1.15  #include <OpenGL/gl.h>          /* Header File For The OpenGL Library */
    1.16  #include <OpenGL/glu.h>         /* Header File For The GLU Library */
    1.17 +#define __X_GL_H
    1.18  #else
    1.19  #include <GL/gl.h>              /* Header File For The OpenGL Library */
    1.20  #include <GL/glu.h>             /* Header File For The GLU Library */
    1.21 @@ -9307,3 +9311,7 @@
    1.22  #endif
    1.23  /* *INDENT-ON* */
    1.24  #endif /* NO_SDL_GLEXT */
    1.25 +
    1.26 +#endif /* _SDL_opengl_h */
    1.27 +
    1.28 +/* vi: set ts=4 sw=4 expandtab: */
     2.1 --- a/src/video/x11/SDL_x11events.c	Sat Sep 05 07:13:01 2009 +0000
     2.2 +++ b/src/video/x11/SDL_x11events.c	Sat Sep 05 07:33:54 2009 +0000
     2.3 @@ -25,11 +25,12 @@
     2.4  #include <sys/time.h>
     2.5  #include <unistd.h>
     2.6  
     2.7 -#include "SDL_syswm.h"
     2.8  #include "SDL_x11video.h"
     2.9  #include "../../events/SDL_events_c.h"
    2.10  #include "../../events/SDL_mouse_c.h"
    2.11  
    2.12 +#include "SDL_syswm.h"
    2.13 +
    2.14  static void
    2.15  X11_DispatchEvent(_THIS)
    2.16  {
     3.1 --- a/src/video/x11/SDL_x11opengl.c	Sat Sep 05 07:13:01 2009 +0000
     3.2 +++ b/src/video/x11/SDL_x11opengl.c	Sat Sep 05 07:33:54 2009 +0000
     3.3 @@ -39,6 +39,10 @@
     3.4  #define DEFAULT_OPENGL	"libGL.so.1"
     3.5  #endif
     3.6  
     3.7 +#ifndef GLX_NONE_EXT
     3.8 +#define GLX_NONE_EXT                       0x8000
     3.9 +#endif
    3.10 +
    3.11  #ifndef GLX_ARB_multisample
    3.12  #define GLX_ARB_multisample
    3.13  #define GLX_SAMPLE_BUFFERS_ARB             100000
     4.1 --- a/src/video/x11/SDL_x11window.c	Sat Sep 05 07:13:01 2009 +0000
     4.2 +++ b/src/video/x11/SDL_x11window.c	Sat Sep 05 07:33:54 2009 +0000
     4.3 @@ -21,7 +21,6 @@
     4.4  */
     4.5  #include "SDL_config.h"
     4.6  
     4.7 -#include "SDL_syswm.h"
     4.8  #include "../SDL_sysvideo.h"
     4.9  #include "../../events/SDL_keyboard_c.h"
    4.10  #include "../../events/SDL_mouse_c.h"
    4.11 @@ -35,6 +34,8 @@
    4.12  #include "SDL_x11opengles.h"
    4.13  #endif
    4.14  
    4.15 +#include "SDL_syswm.h"
    4.16 +
    4.17  #define _NET_WM_STATE_REMOVE    0l
    4.18  #define _NET_WM_STATE_ADD       1l
    4.19  #define _NET_WM_STATE_TOGGLE    2l