Fixed use of SDL with XInitThreads()

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40691
This commit is contained in:
Sam Lantinga 2003-08-23 23:12:19 +00:00
parent 3095e05ea7
commit dc54e92e13
3 changed files with 14 additions and 1 deletions

View file

@ -553,7 +553,7 @@ CheckX11()
AC_PATH_X AC_PATH_X
AC_PATH_XTRA AC_PATH_XTRA
if test x$have_x = xyes; then if test x$have_x = xyes; then
CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -I$srcdir/include -I$srcdir/src/video" CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
if test x$ac_cv_func_shmat != xyes; then if test x$ac_cv_func_shmat != xyes; then
CFLAGS="$CFLAGS -DNO_SHARED_MEMORY" CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
fi fi

View file

@ -7,3 +7,4 @@ You can't link static library code into shared libraries on non-x86
Linux platforms. Since these libraries haven't become standard yet, Linux platforms. Since these libraries haven't become standard yet,
we'll just include them directly. we'll just include them directly.
These sources are synchronized with XFree86 4.2.1

View file

@ -344,6 +344,8 @@ SDL_NAME(XF86VidModeGetAllModeLines)(dpy, screen, modecount, modelinesPtr)
else else
_XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo)); _XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
Xfree(modelines); Xfree(modelines);
UnlockDisplay(dpy);
SyncHandle();
return False; return False;
} }
mdinfptr = (SDL_NAME(XF86VidModeModeInfo) *) ( mdinfptr = (SDL_NAME(XF86VidModeModeInfo) *) (
@ -925,6 +927,8 @@ SDL_NAME(XF86VidModeGetMonitor)(dpy, screen, monitor)
if (!(monitor->vendor = (char *)Xcalloc(rep.vendorLength + 1, 1))) { if (!(monitor->vendor = (char *)Xcalloc(rep.vendorLength + 1, 1))) {
_XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 + _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3)); ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
return False; return False;
} }
} else { } else {
@ -936,6 +940,8 @@ SDL_NAME(XF86VidModeGetMonitor)(dpy, screen, monitor)
((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3)); ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
if (monitor->vendor) if (monitor->vendor)
Xfree(monitor->vendor); Xfree(monitor->vendor);
UnlockDisplay(dpy);
SyncHandle();
return False; return False;
} }
} else { } else {
@ -949,6 +955,8 @@ SDL_NAME(XF86VidModeGetMonitor)(dpy, screen, monitor)
Xfree(monitor->vendor); Xfree(monitor->vendor);
if (monitor->model) if (monitor->model)
Xfree(monitor->model); Xfree(monitor->model);
UnlockDisplay(dpy);
SyncHandle();
return False; return False;
} }
if (!(monitor->vsync = Xcalloc(rep.nvsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) { if (!(monitor->vsync = Xcalloc(rep.nvsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
@ -959,6 +967,8 @@ SDL_NAME(XF86VidModeGetMonitor)(dpy, screen, monitor)
if (monitor->model) if (monitor->model)
Xfree(monitor->model); Xfree(monitor->model);
Xfree(monitor->hsync); Xfree(monitor->hsync);
UnlockDisplay(dpy);
SyncHandle();
return False; return False;
} }
for (i = 0; i < rep.nhsync; i++) { for (i = 0; i < rep.nhsync; i++) {
@ -1096,6 +1106,8 @@ SDL_NAME(XF86VidModeGetDotClocks)(dpy, screen,
if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) { if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) {
_XEatData(dpy, (rep.clocks) * 4); _XEatData(dpy, (rep.clocks) * 4);
Xfree(dotclocks); Xfree(dotclocks);
UnlockDisplay(dpy);
SyncHandle();
return False; return False;
} }