Commit a8366ab9 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Corrects dynamic X11 code on Tru64 systems.

Fixes Bugzilla #87.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401302
parent 1432f548
...@@ -619,6 +619,10 @@ CheckX11() ...@@ -619,6 +619,10 @@ CheckX11()
x11_lib='/usr/X11R6/lib/libX11.6.dylib' x11_lib='/usr/X11R6/lib/libX11.6.dylib'
x11ext_lib='/usr/X11R6/lib/libXext.6.dylib' x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
;; ;;
*-*-osf* )
x11_lib='libX11.so'
x11ext_lib='libXext.so'
;;
*) *)
x11_lib='libX11.so.6' x11_lib='libX11.so.6'
x11ext_lib='libXext.so.6' x11ext_lib='libXext.so.6'
...@@ -2585,6 +2589,13 @@ case "$target" in ...@@ -2585,6 +2589,13 @@ case "$target" in
if test x$enable_timers = xyes; then if test x$enable_timers = xyes; then
COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
fi fi
# FIXME: If building without -lX11, you get the following messages.
# Xlib: connection to ":0.0" refused by server
# Xlib: XDM authorization key matches an existing client!
# It only has to run xhost +localhost in a such case.
#if test x$enable_x11_shared = xyes; then
# SYSTEM_LIBS="$SYSTEM_LIBS -lX11"
#fi
;; ;;
*-*-qnx*) *-*-qnx*)
ARCH=qnx ARCH=qnx
......
...@@ -72,10 +72,21 @@ typedef int (*SDL_X11_XSetExtensionErrorHandlerType)(Display *,char *,char *); ...@@ -72,10 +72,21 @@ typedef int (*SDL_X11_XSetExtensionErrorHandlerType)(Display *,char *,char *);
#define _XFlushGCCache p_XFlushGCCache #define _XFlushGCCache p_XFlushGCCache
#define _XReply p_XReply #define _XReply p_XReply
#define _XSend p_XSend #define _XSend p_XSend
#define _XData32 p_XData32
#define XFree pXFree #define XFree pXFree
#if !defined(__osf__) || defined(X11_DYNAMIC)
#define _XData32 p_XData32
#endif #endif
#if defined(__osf__) && defined(X11_DYNAMIC)
#define _SmtBufferOverflow p_SmtBufferOverflow
#define _SmtIpError p_SmtIpError
#define ipAllocateData pipAllocateData
#define ipUnallocateAndSendData pipUnallocateAndSendData
#endif
#endif /* !__SDL_NO_REDEFINE_X11_HEADER_SYMS */
int SDL_X11_LoadSymbols(void); int SDL_X11_LoadSymbols(void);
void SDL_X11_UnloadSymbols(void); void SDL_X11_UnloadSymbols(void);
......
...@@ -139,11 +139,18 @@ SDL_X11_SYM(1,unsigned long,_XSetLastRequestRead,(Display*,xGenericReply*)) ...@@ -139,11 +139,18 @@ SDL_X11_SYM(1,unsigned long,_XSetLastRequestRead,(Display*,xGenericReply*))
* These don't exist in 32-bit versions and are removed by Xlib macros, but * These don't exist in 32-bit versions and are removed by Xlib macros, but
* 64+ bit systems will use them. * 64+ bit systems will use them.
*/ */
#ifdef LONG64 #if defined(LONG64) && !defined(__osf__) || defined(X11_DYNAMIC)
SDL_X11_SYM(1,int,_XData32,(Display *dpy,register long *data,unsigned len)) SDL_X11_SYM(1,int,_XData32,(Display *dpy,register long *data,unsigned len))
SDL_X11_SYM(1,void,_XRead32,(Display *dpy,register long *data,long len)) SDL_X11_SYM(1,void,_XRead32,(Display *dpy,register long *data,long len))
#endif #endif
#if defined(__osf__) && defined(X11_DYNAMIC)
SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
SDL_X11_SYM(1,void,_SmtIpError,(Display *dpy,register smtDisplayPtr, int))
SDL_X11_SYM(1,int,ipAllocateData,(ChannelPtr, IPCard, IPDataPtr *))
SDL_X11_SYM(1,int,ipUnallocateAndSendData,(ChannelPtr, IPCard))
#endif
#if NeedWidePrototypes #if NeedWidePrototypes
SDL_X11_SYM(1,KeySym,XKeycodeToKeysym,(Display*,unsigned int,int)) SDL_X11_SYM(1,KeySym,XKeycodeToKeysym,(Display*,unsigned int,int))
#else #else
......
...@@ -436,6 +436,20 @@ static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat) ...@@ -436,6 +436,20 @@ static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat)
local_X11 = 0; local_X11 = 0;
} }
SDL_Display = pXOpenDisplay(display); SDL_Display = pXOpenDisplay(display);
#if defined(__osf__) && defined(X11_DYNAMIC)
/* On Tru64 if linking without -lX11, it fails and you get following message.
* Xlib: connection to ":0.0" refused by server
* Xlib: XDM authorization key matches an existing client!
*
* It succeeds if retrying 1 second later
* or if running xhost +localhost on shell.
*
*/
if ( SDL_Display == NULL ) {
SDL_Delay(1000);
SDL_Display = pXOpenDisplay(display);
}
#endif
if ( SDL_Display == NULL ) { if ( SDL_Display == NULL ) {
SDL_SetError("Couldn't open X11 display"); SDL_SetError("Couldn't open X11 display");
return(-1); return(-1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment