mirror of
https://github.com/X11Libre/xf86-video-sis.git
synced 2026-03-23 17:19:39 +00:00
fix FTBS on XSERVER_LIBPCIACCESS
Not all Xserver versions define that symbol with a numeric value
(1 or 0), some just might not define it at all when disabled.
Using #if instead of #ifdef (as most sites do) will lead to compile break:
../../src/sis_driver.c:4008:25: error: expected value in expression
#if XSERVER_LIBPCIACCESS
^
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-sis/-/merge_requests/27>
This commit is contained in:
committed by
Marge Bot
parent
a1f6d0148e
commit
fb3b448df7
@@ -4005,7 +4005,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
|
||||
biossize = 0x8000;
|
||||
break;
|
||||
}
|
||||
#if XSERVER_LIBPCIACCESS
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
if(readpci) {
|
||||
pSiS->PciInfo->rom_size = biossize;
|
||||
pci_device_read_rom(pSiS->PciInfo, pSiS->BIOS);
|
||||
|
||||
@@ -1704,7 +1704,7 @@ SiSVGAMapMem(ScrnInfoPtr pScrn)
|
||||
if(pSiS->VGAMapSize == 0) pSiS->VGAMapSize = (64 * 1024);
|
||||
if(pSiS->VGAMapPhys == 0) pSiS->VGAMapPhys = 0xA0000;
|
||||
|
||||
#if XSERVER_LIBPCIACCESS
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
(void) pci_device_map_legacy(pSiS->PciInfo, pSiS->VGAMapPhys, pSiS->VGAMapSize,
|
||||
PCI_DEV_MAP_FLAG_WRITABLE, &pSiS->VGAMemBase);
|
||||
#else
|
||||
@@ -1722,7 +1722,7 @@ SiSVGAUnmapMem(ScrnInfoPtr pScrn)
|
||||
|
||||
if(pSiS->VGAMemBase == NULL) return;
|
||||
|
||||
#if XSERVER_LIBPCIACCESS
|
||||
#ifdef XSERVER_LIBPCIACCESS
|
||||
(void) pci_device_unmap_legacy(pSiS->PciInfo, pSiS->VGAMemBase, pSiS->VGAMapSize);
|
||||
#else
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, pSiS->VGAMemBase, pSiS->VGAMapSize);
|
||||
|
||||
Reference in New Issue
Block a user