From 9f7d487f75dc65edf7285326c54873c0cab95d95 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Mon, 21 Jul 2008 15:38:00 -0300 Subject: [PATCH] Protect xf86rush dependent code around #ifdef XF86RUSH Also correct an incorrect #ifndef -> #ifdef, so that the driver now doesn't have any calls to non existent symbols. --- src/apm.h | 2 ++ src/apm_driver.c | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/apm.h b/src/apm.h index 3d500c3..7c0bfda 100644 --- a/src/apm.h +++ b/src/apm.h @@ -242,8 +242,10 @@ extern void ApmAdjustFrame(int scrnIndex, int x, int y, int flags); extern void ApmHWCursorReserveSpace(ApmPtr pApm); extern void ApmAccelReserveSpace(ApmPtr pApm); +#ifdef XF86RUSH extern int ApmPixmapIndex; #define APM_GET_PIXMAP_PRIVATE(pix)\ ((ApmPixmapPtr)(((PixmapPtr)(pix))->devPrivates[ApmPixmapIndex].ptr)) +#endif #include "apm_regs.h" diff --git a/src/apm_driver.c b/src/apm_driver.c index 49b74d3..9106d1f 100644 --- a/src/apm_driver.c +++ b/src/apm_driver.c @@ -53,9 +53,10 @@ static void ApmDisplayPowerManagementSet(ScrnInfoPtr pScrn, int flags); static void ApmProbeDDC(ScrnInfoPtr pScrn, int index); - +#ifdef XF86RUSH int ApmPixmapIndex = -1; static unsigned long ApmGeneration = 0; +#endif _X_EXPORT DriverRec APM = { APM_VERSION, @@ -1998,7 +1999,7 @@ ApmScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) miSetPixmapDepths(); switch (pScrn->bitsPerPixel) { -#ifndef HAVE_XF1BPP +#ifdef HAVE_XF1BPP case 1: ret = xf1bppScreenInit(pScreen, FbBase, pScrn->virtualX, pScrn->virtualY, @@ -2120,6 +2121,7 @@ ApmScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); } +#ifdef XF86RUSH if (ApmGeneration != serverGeneration) { if ((ApmPixmapIndex = AllocatePixmapPrivateIndex()) < 0) return FALSE; @@ -2128,6 +2130,7 @@ ApmScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!AllocatePixmapPrivate(pScreen, ApmPixmapIndex, sizeof(ApmPixmapRec))) return FALSE; +#endif /* Done */ return TRUE; -- 1.5.6