Do not compile code that makes use of the X Shm extension.

This commit is contained in:
Dimitrie O. Paun 2000-11-26 03:59:20 +00:00 committed by Alexandre Julliard
parent dfd3d4ada2
commit 470acf831f
2 changed files with 16 additions and 2 deletions

View File

@ -3079,10 +3079,11 @@ INT X11DRV_DIB_GetDIBits(
{ {
descr.ySrc = startscan; descr.ySrc = startscan;
} }
#ifdef HAVE_LIBXXSHM
if (dib) if (dib)
descr.useShm = (dib->shminfo.shmid != -1); descr.useShm = (dib->shminfo.shmid != -1);
else else
#endif
descr.useShm = FALSE; descr.useShm = FALSE;
EnterCriticalSection( &X11DRV_CritSection ); EnterCriticalSection( &X11DRV_CritSection );
@ -3176,7 +3177,11 @@ static void X11DRV_DIB_DoUpdateDIBSection(BITMAPOBJ *bmp, BOOL toDIB)
descr.yDest = 0; descr.yDest = 0;
descr.width = bmp->bitmap.bmWidth; descr.width = bmp->bitmap.bmWidth;
descr.height = bmp->bitmap.bmHeight; descr.height = bmp->bitmap.bmHeight;
#ifdef HAVE_LIBXXSHM
descr.useShm = (dib->shminfo.shmid != -1); descr.useShm = (dib->shminfo.shmid != -1);
#else
descr.useShm = FALSE;
#endif
if (toDIB) if (toDIB)
{ {
@ -3388,6 +3393,7 @@ static int XShmErrorHandler(Display *dpy, XErrorEvent *event)
* *
*/ */
#ifdef HAVE_LIBXXSHM
extern BOOL X11DRV_XShmCreateImage(XImage** image, int width, int height, int bpp, extern BOOL X11DRV_XShmCreateImage(XImage** image, int width, int height, int bpp,
XShmSegmentInfo* shminfo) XShmSegmentInfo* shminfo)
{ {
@ -3435,7 +3441,7 @@ extern BOOL X11DRV_XShmCreateImage(XImage** image, int width, int height, int bp
} }
return FALSE; return FALSE;
} }
#endif /* HAVE_LIBXXSHM */
@ -3557,6 +3563,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
/* Create XImage */ /* Create XImage */
if (dib && bmp) if (dib && bmp)
{ {
#ifdef HAVE_LIBXXSHM
if (TSXShmQueryExtension(display) && if (TSXShmQueryExtension(display) &&
X11DRV_XShmCreateImage( &dib->image, bm.bmWidth, effHeight, X11DRV_XShmCreateImage( &dib->image, bm.bmWidth, effHeight,
bmp->bitmap.bmBitsPixel, &dib->shminfo ) ) bmp->bitmap.bmBitsPixel, &dib->shminfo ) )
@ -3566,6 +3573,9 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
XCREATEIMAGE( dib->image, bm.bmWidth, effHeight, bmp->bitmap.bmBitsPixel ); XCREATEIMAGE( dib->image, bm.bmWidth, effHeight, bmp->bitmap.bmBitsPixel );
dib->shminfo.shmid = -1; dib->shminfo.shmid = -1;
} }
#else
XCREATEIMAGE( dib->image, bm.bmWidth, effHeight, bmp->bitmap.bmBitsPixel );
#endif
} }
/* Clean up in case of errors */ /* Clean up in case of errors */
@ -3621,6 +3631,7 @@ void X11DRV_DIB_DeleteDIBSection(BITMAPOBJ *bmp)
if (dib->image) if (dib->image)
{ {
#ifdef HAVE_LIBXXSHM
if (dib->shminfo.shmid != -1) if (dib->shminfo.shmid != -1)
{ {
TSXShmDetach (display, &(dib->shminfo)); TSXShmDetach (display, &(dib->shminfo));
@ -3629,6 +3640,7 @@ void X11DRV_DIB_DeleteDIBSection(BITMAPOBJ *bmp)
dib->shminfo.shmid = -1; dib->shminfo.shmid = -1;
} }
else else
#endif
XDestroyImage( dib->image ); XDestroyImage( dib->image );
} }

View File

@ -226,8 +226,10 @@ typedef struct
/* Selector for 16-bit access to bits */ /* Selector for 16-bit access to bits */
WORD selector; WORD selector;
#ifdef HAVE_LIBXXSHM
/* Shared memory segment info */ /* Shared memory segment info */
XShmSegmentInfo shminfo; XShmSegmentInfo shminfo;
#endif
} X11DRV_DIBSECTION; } X11DRV_DIBSECTION;