annotate src/video/x11/SDL_x11dyn.h @ 1438:1f4f09641645

Date: Sun, 26 Feb 2006 11:25:09 +0900 From: Hayashi Naoyuki Subject: Re: [SDL] CVS stable again, please update SDL ports Some problems are caused on Tru64 UNIX. If applying SDL12-osf1.path, these problems are fixed. 1. configure-script say "recursive mutexes... no" and "pthread semaphores... no". checking for pthreads... yes checking for recursive mutexes... no checking for pthread semaphores... no This is because it compiled without pthread_cflags and pthread_lib when checking recursive mutexes and pthread semaphores. 2. Compiling src/audio/mme/SDL_mmeaudio.c fails. cc: Severe: ./src/audio/mme/SDL_mmeaudio.c, line 25: Cannot find file <mme_api.h> specified in #include directive. (noinclfilef) #include <mme_api.h> -^ This is because BUILD_CFLAGS is wrong. 3. Compiling src/cdrom/osf/SDL_syscdrom.c fails. cc: Warning: ./src/cdrom/osf/SDL_syscdrom.c, line 176: Too few actual parameters in the invocation of the macro "SDL_stack_alloc". (toofewactuals) cdpath = SDL_stack_alloc(len); ------------------------------------^ cc: Error: ./src/cdrom/osf/SDL_syscdrom.c, line 176: Invalid expression. (badexpr) cdpath = SDL_stack_alloc(len); -----------------^ SDL_stack_alloc is defined in include/SDL_stdinc.h. #define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*count) 4. Linking fails if running configure with --enable-x11-shared=yes. /usr/ccs/bin/ld: Warning: Unresolved: p_XData32 5. Compiling src/video/x11/SDL_x11dyn.c fails if running configure with --enable-x11-shared=no. cc: Error: ./src/video/x11/SDL_x11sym.h, line 149: In this statement, "_SmtBufferOverflow" is not declared. (undeclared) SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr)) ^ cc: Error: ./src/video/x11/SDL_x11sym.h, line 150: In this statement, "_SmtBufferOverflow" is not declared. (undeclared) SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr)) ^ cc: Error: ./src/video/x11/SDL_x11sym.h, line 150: In this statement, "_SmtIpError" is not declared. (undeclared) SDL_X11_SYM(1,void,_SmtIpError,(Display *dpy,register smtDisplayPtr, int)) ^
author Sam Lantinga <slouken@libsdl.org>
date Sun, 26 Feb 2006 04:54:01 +0000
parents d910939febfa
children 3ba88cb7eb1b
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 */
1402
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1361
diff changeset
22 #include "SDL_config.h"
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
23
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
24 #ifndef _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
25 #define _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
26
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
27 #include <X11/Xlib.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
28 #include <X11/Xutil.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
29 #include <X11/Xatom.h>
1351
82c38796c7ca Changed X11 header order so it works on Solaris.
Ryan C. Gordon <icculus@icculus.org>
parents: 1314
diff changeset
30 #include <X11/Xlibint.h>
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
31 #include <X11/Xproto.h>
1169
4b3e2294782d Date: Sun, 06 Nov 2005 18:23:03 +0900
Ryan C. Gordon <icculus@icculus.org>
parents: 1168
diff changeset
32
1361
19418e4422cb New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents: 1351
diff changeset
33 #include "../Xext/extensions/extutil.h"
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
34
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
35 #ifndef NO_SHARED_MEMORY
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
36 #include <sys/ipc.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
37 #include <sys/shm.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 <X11/extensions/XShm.h>
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
39 #endif
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
40
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
41 /*
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
42 * Never reference Xlib directly...we might load it dynamically at runtime.
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
43 * Even if we don't, for readability, we still use the function pointers
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
44 * (although the symbol resolution will be done by the loader in that case).
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
45 *
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
46 * We define SDL_X11_SYM and include SDL_x11sym.h to accomplish various
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
47 * goals, without having to duplicate those function signatures.
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
48 */
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
49 #ifdef __cplusplus
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
50 extern "C" {
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
51 #endif
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
52
1438
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
53 #ifdef __osf__
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
54 extern int _XData32(Display *,register long *,unsigned);
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
55 extern void _XRead32(Display *,register long *,long);
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
56 extern void _SmtBufferOverflow(Display *,register smtDisplayPtr);
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
57 extern void _SmtIpError(Display *,register smtDisplayPtr, int);
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
58 extern int ipAllocateData(ChannelPtr, IPCard, IPDataPtr *);
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
59 extern int ipUnallocateAndSendData(ChannelPtr, IPCard);
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
60 #endif
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
61
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
62 /* evil function signatures... */
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
63 typedef Bool (*SDL_X11_XESetWireToEventRetType)(Display*,XEvent*,xEvent*);
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
64 typedef int (*SDL_X11_XSynchronizeRetType)(Display*);
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
65 typedef Status (*SDL_X11_XESetEventToWireRetType)(Display*,XEvent*,xEvent*);
1248
d2c6881935be Catch X11 extension errors...since most of these are notifications that we
Ryan C. Gordon <icculus@icculus.org>
parents: 1244
diff changeset
66 typedef int (*SDL_X11_XSetExtensionErrorHandlerType)(Display *,char *,char *);
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
67
1235
f60f6f4ffc6f Make some dynamic X11 symbols option. _XData32 and _XRead32 are only available
Ryan C. Gordon <icculus@icculus.org>
parents: 1226
diff changeset
68 #define SDL_X11_SYM(req,ret,fn,params) extern ret (*p##fn) params;
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
69 #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
70 #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
71
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
72 /* Macro in the xlib headers, not an actual symbol... */
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
73 #define pXDestroyImage XDestroyImage
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
74
1226
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
75 /* Workaround code in headers... */
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
76 #if !__SDL_NO_REDEFINE_X11_HEADER_SYMS
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
77 #define _XFlush p_XFlush
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
78 #define _XFlushGCCache p_XFlushGCCache
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
79 #define _XReply p_XReply
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
80 #define _XSend p_XSend
1299
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
81 #define XFree pXFree
1226
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
82 #define _XData32 p_XData32
d05306f0dc21 More dynamic X11 fixes...catches some code in Xlib headers that caused
Ryan C. Gordon <icculus@icculus.org>
parents: 1169
diff changeset
83
1438
1f4f09641645 Date: Sun, 26 Feb 2006 11:25:09 +0900
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
84 #if defined(__osf__)
1299
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
85 #define _SmtBufferOverflow p_SmtBufferOverflow
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
86 #define _SmtIpError p_SmtIpError
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
87 #define ipAllocateData pipAllocateData
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
88 #define ipUnallocateAndSendData pipUnallocateAndSendData
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
89 #endif
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
90
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
91 #endif /* !__SDL_NO_REDEFINE_X11_HEADER_SYMS */
2bf9dda618e5 Corrects dynamic X11 code on Tru64 systems.
Ryan C. Gordon <icculus@icculus.org>
parents: 1248
diff changeset
92
1168
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
93 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
94 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
95
045f186426e1 Dynamically load X11 libraries like we currently do for alsa, esd, etc.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
96 #ifdef __cplusplus
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 #endif /* !defined _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
101