Skip to content
Permalink
Browse files

Corrects dynamic X11 code on Tru64 systems.

Fixes Bugzilla #87.
  • Loading branch information
icculus committed Jan 30, 2006
1 parent af1cbe0 commit cad0f266c266c29e50f23c6a2ecbacadf4382ebe
Showing with 45 additions and 2 deletions.
  1. +11 −0 configure.in
  2. +12 −1 src/video/x11/SDL_x11dyn.h
  3. +8 −1 src/video/x11/SDL_x11sym.h
  4. +14 −0 src/video/x11/SDL_x11video.c
@@ -619,6 +619,10 @@ CheckX11()
x11_lib='/usr/X11R6/lib/libX11.6.dylib'
x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
;;
*-*-osf* )
x11_lib='libX11.so'
x11ext_lib='libXext.so'
;;
*)
x11_lib='libX11.so.6'
x11ext_lib='libXext.so.6'
@@ -2585,6 +2589,13 @@ case "$target" in
if test x$enable_timers = xyes; then
COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
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*)
ARCH=qnx
@@ -72,10 +72,21 @@ typedef int (*SDL_X11_XSetExtensionErrorHandlerType)(Display *,char *,char *);
#define _XFlushGCCache p_XFlushGCCache
#define _XReply p_XReply
#define _XSend p_XSend
#define _XData32 p_XData32
#define XFree pXFree

#if !defined(__osf__) || defined(X11_DYNAMIC)
#define _XData32 p_XData32
#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);
void SDL_X11_UnloadSymbols(void);

@@ -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
* 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,void,_XRead32,(Display *dpy,register long *data,long len))
#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
SDL_X11_SYM(1,KeySym,XKeycodeToKeysym,(Display*,unsigned int,int))
#else
@@ -436,6 +436,20 @@ static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat)
local_X11 = 0;
}
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 ) {
SDL_SetError("Couldn't open X11 display");
return(-1);

0 comments on commit cad0f26

Please sign in to comment.