mirror of
https://github.com/X11Libre/xf86-video-sis.git
synced 2026-03-24 01:25:01 +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;
|
biossize = 0x8000;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if XSERVER_LIBPCIACCESS
|
#ifdef XSERVER_LIBPCIACCESS
|
||||||
if(readpci) {
|
if(readpci) {
|
||||||
pSiS->PciInfo->rom_size = biossize;
|
pSiS->PciInfo->rom_size = biossize;
|
||||||
pci_device_read_rom(pSiS->PciInfo, pSiS->BIOS);
|
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->VGAMapSize == 0) pSiS->VGAMapSize = (64 * 1024);
|
||||||
if(pSiS->VGAMapPhys == 0) pSiS->VGAMapPhys = 0xA0000;
|
if(pSiS->VGAMapPhys == 0) pSiS->VGAMapPhys = 0xA0000;
|
||||||
|
|
||||||
#if XSERVER_LIBPCIACCESS
|
#ifdef XSERVER_LIBPCIACCESS
|
||||||
(void) pci_device_map_legacy(pSiS->PciInfo, pSiS->VGAMapPhys, pSiS->VGAMapSize,
|
(void) pci_device_map_legacy(pSiS->PciInfo, pSiS->VGAMapPhys, pSiS->VGAMapSize,
|
||||||
PCI_DEV_MAP_FLAG_WRITABLE, &pSiS->VGAMemBase);
|
PCI_DEV_MAP_FLAG_WRITABLE, &pSiS->VGAMemBase);
|
||||||
#else
|
#else
|
||||||
@@ -1722,7 +1722,7 @@ SiSVGAUnmapMem(ScrnInfoPtr pScrn)
|
|||||||
|
|
||||||
if(pSiS->VGAMemBase == NULL) return;
|
if(pSiS->VGAMemBase == NULL) return;
|
||||||
|
|
||||||
#if XSERVER_LIBPCIACCESS
|
#ifdef XSERVER_LIBPCIACCESS
|
||||||
(void) pci_device_unmap_legacy(pSiS->PciInfo, pSiS->VGAMemBase, pSiS->VGAMapSize);
|
(void) pci_device_unmap_legacy(pSiS->PciInfo, pSiS->VGAMemBase, pSiS->VGAMapSize);
|
||||||
#else
|
#else
|
||||||
xf86UnMapVidMem(pScrn->scrnIndex, pSiS->VGAMemBase, pSiS->VGAMapSize);
|
xf86UnMapVidMem(pScrn->scrnIndex, pSiS->VGAMemBase, pSiS->VGAMapSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user