Mercurial > sdl-ios-xcode
annotate src/video/x11/SDL_x11dyn.c @ 1361:19418e4422cb
New configure-based build system. Still work in progress, but much improved
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 16 Feb 2006 10:11:48 +0000 |
parents | fe7d081a4955 |
children | d910939febfa |
rev | line source |
---|---|
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
1 /* |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
3 Copyright (C) 1997-2004 Sam Lantinga |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
4 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Library General Public |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
8 version 2 of the License, or (at your option) any later version. |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
9 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
13 Library General Public License for more details. |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
14 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Library General Public |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
18 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
19 Sam Lantinga |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
20 slouken@libsdl.org |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
21 */ |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
22 |
1235
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
23 #if 0 |
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
24 #define DEBUG_DYNAMIC_X11 1 |
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
25 #endif |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
26 |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1245
diff
changeset
|
27 #include "SDL_config.h" |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1245
diff
changeset
|
28 |
1226
d05306f0dc21
More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents:
1171
diff
changeset
|
29 #define __SDL_NO_REDEFINE_X11_HEADER_SYMS 1 |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
30 #include "SDL_x11dyn.h" |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
31 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
32 #ifdef DEBUG_DYNAMIC_X11 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
33 #include <stdio.h> |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
34 #endif |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
35 |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1245
diff
changeset
|
36 #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
37 #include <dlfcn.h> |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
38 #include "SDL_name.h" |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
39 #include "SDL_loadso.h" |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1245
diff
changeset
|
40 static const char *x11_library = SDL_VIDEO_DRIVER_X11_DYNAMIC; |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
41 static void *x11_handle = NULL; |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1245
diff
changeset
|
42 static const char *x11ext_library = SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT; |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
43 static void *x11ext_handle = NULL; |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
44 |
1235
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
45 static void *X11_GetSym(int required, const char *fnname, int *rc) |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
46 { |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
47 void *fn = NULL; |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
48 if (*rc) { /* haven't already failed on a previous lookup? */ |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
49 fn = SDL_LoadFunction(x11_handle, fnname); |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
50 #if DEBUG_DYNAMIC_X11 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
51 if (fn != NULL) |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
52 printf("X11: Found '%s' in libX11 (%p)\n", fnname, fn); |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
53 #endif |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
54 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
55 if (fn == NULL) { /* not found? Check libX11ext ... */ |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
56 fn = SDL_LoadFunction(x11ext_handle, fnname); |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
57 #if DEBUG_DYNAMIC_X11 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
58 if (fn != NULL) |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
59 printf("X11: Found '%s' in libXext (%p)\n", fnname, fn); |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
60 else |
1245
fe7d081a4955
Patched to compile with debugging enabled.
Ryan C. Gordon <icculus@icculus.org>
parents:
1236
diff
changeset
|
61 printf("X11: Symbol '%s' NOT FOUND!%s\n", fnname, |
1236
ed252764287a
Minor bit of debug output added to dynamic X11 code.
Ryan C. Gordon <icculus@icculus.org>
parents:
1235
diff
changeset
|
62 required ? "" : " (...but not required!)"); |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
63 #endif |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
64 } |
1235
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
65 *rc = ((fn != NULL) || (!required)); |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
66 } |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
67 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
68 return fn; |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
69 } |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1245
diff
changeset
|
70 #endif /* SDL_VIDEO_DRIVER_X11_DYNAMIC */ |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
71 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
72 /* Define all the function pointers... */ |
1235
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
73 #define SDL_X11_SYM(req,ret,fn,params) ret (*p##fn) params = NULL; |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
74 #include "SDL_x11sym.h" |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
75 #undef SDL_X11_SYM |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
76 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
77 static int x11_load_refcount = 0; |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
78 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
79 void SDL_X11_UnloadSymbols(void) |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
80 { |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
81 /* Don't actually unload if more than one module is using the libs... */ |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
82 if (x11_load_refcount > 0) { |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
83 if (--x11_load_refcount == 0) { |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
84 /* set all the function pointers to NULL. */ |
1235
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
85 #define SDL_X11_SYM(req,ret,fn,params) p##fn = NULL; |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
86 #include "SDL_x11sym.h" |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
87 #undef SDL_X11_SYM |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
88 |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1245
diff
changeset
|
89 #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
90 if (x11_handle != NULL) { |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
91 SDL_UnloadObject(x11_handle); |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
92 x11_handle = NULL; |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
93 } |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
94 if (x11ext_handle != NULL) { |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
95 SDL_UnloadObject(x11ext_handle); |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
96 x11ext_handle = NULL; |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
97 } |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
98 #endif |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
99 } |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
100 } |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
101 } |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
102 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
103 /* returns non-zero if all needed symbols were loaded. */ |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
104 int SDL_X11_LoadSymbols(void) |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
105 { |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
106 int rc = 1; |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
107 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
108 /* deal with multiple modules (dga, x11, etc) needing these symbols... */ |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
109 if (x11_load_refcount++ == 0) { |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1245
diff
changeset
|
110 #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
111 x11_handle = SDL_LoadObject(x11_library); |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
112 x11ext_handle = SDL_LoadObject(x11ext_library); |
1171
f84c6f1397cd
Fixed crash when dynamic X11 fails to load system Xlib libraries at runtime.
Ryan C. Gordon <icculus@icculus.org>
parents:
1168
diff
changeset
|
113 rc = ((x11_handle != NULL) && (x11ext_handle != NULL)); |
1235
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
114 #define SDL_X11_SYM(req,r,fn,arg) p##fn = X11_GetSym(req,#fn, &rc); |
1171
f84c6f1397cd
Fixed crash when dynamic X11 fails to load system Xlib libraries at runtime.
Ryan C. Gordon <icculus@icculus.org>
parents:
1168
diff
changeset
|
115 #include "SDL_x11sym.h" |
f84c6f1397cd
Fixed crash when dynamic X11 fails to load system Xlib libraries at runtime.
Ryan C. Gordon <icculus@icculus.org>
parents:
1168
diff
changeset
|
116 #undef SDL_X11_SYM |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
117 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
118 if (!rc) |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
119 SDL_X11_UnloadSymbols(); /* in case one of these loaded... */ |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
120 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
121 #else |
1235
f60f6f4ffc6f
Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents:
1226
diff
changeset
|
122 #define SDL_X11_SYM(req,r,fn,arg) p##fn = fn; |
1168
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
123 #include "SDL_x11sym.h" |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
124 #undef SDL_X11_SYM |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
125 #endif |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
126 } |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
127 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
128 return rc; |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
129 } |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
130 |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
131 /* end of SDL_x11dyn.c ... */ |
045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff
changeset
|
132 |