recipes: xorg/driver/*: Fix build issues by fixing old cpp macros references
[dragora.git] / patches / xf86-video-vmware / fix-old-cpp-macros_vmware.patch
blobac05a818c7e239d09bc8691fd22e4fd6c85110e8
1 Upstream: no (Too lazy)
2 Reason: newer GCC don't work with these macros
4 diff --git a/src/vmware.c b/src/vmware.c
5 index bd8ec37..1bc1fac 100644
6 --- a/src/vmware.c
7 +++ b/src/vmware.c
8 @@ -341,7 +341,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
9 SVGA_LEGACY_BASE_PORT + SVGA_VALUE_PORT*sizeof(uint32);
10 } else {
11 /* Note: This setting of valueReg causes unaligned I/O */
12 -#if XSERVER_LIBPCIACCESS
13 +#if defined(XSERVER_LIBPCIACCESS)
14 pVMWARE->portIOBase = pVMWARE->PciInfo->regions[0].base_addr;
15 #else
16 pVMWARE->portIOBase = pVMWARE->PciInfo->ioBase[0];
17 @@ -383,7 +383,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
19 pVMWARE->suspensionSavedRegId = id;
21 -#if !XSERVER_LIBPCIACCESS
22 +#ifndef XSERVER_LIBPCIACCESS
23 pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device,
24 pVMWARE->PciInfo->func);
25 #endif
26 @@ -727,13 +727,13 @@ static Bool
27 VMWAREMapMem(ScrnInfoPtr pScrn)
29 VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
30 -#if XSERVER_LIBPCIACCESS
31 +#if defined(XSERVER_LIBPCIACCESS)
32 int err;
33 struct pci_device *const device = pVMWARE->PciInfo;
34 void *fbBase;
35 #endif
37 -#if XSERVER_LIBPCIACCESS
38 +#if defined(XSERVER_LIBPCIACCESS)
39 err = pci_device_map_range(device,
40 pVMWARE->memPhysBase,
41 pVMWARE->videoRam,
42 @@ -770,7 +770,7 @@ VMWAREUnmapMem(ScrnInfoPtr pScrn)
44 VmwareLog(("Unmapped: %p/%u\n", pVMWARE->FbBase, pVMWARE->videoRam));
46 -#if XSERVER_LIBPCIACCESS
47 +#if defined(XSERVER_LIBPCIACCESS)
48 pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->FbBase, pVMWARE->videoRam);
49 #else
50 xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->FbBase, pVMWARE->videoRam);
51 @@ -1045,7 +1045,7 @@ static void
52 VMWAREInitFIFO(ScrnInfoPtr pScrn)
54 VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
55 -#if XSERVER_LIBPCIACCESS
56 +#if defined(XSERVER_LIBPCIACCESS)
57 struct pci_device *const device = pVMWARE->PciInfo;
58 int err;
59 void *mmioVirtBase;
60 @@ -1058,7 +1058,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn)
62 pVMWARE->mmioPhysBase = vmwareReadReg(pVMWARE, SVGA_REG_MEM_START);
63 pVMWARE->mmioSize = vmwareReadReg(pVMWARE, SVGA_REG_MEM_SIZE) & ~3;
64 -#if XSERVER_LIBPCIACCESS
65 +#if defined(XSERVER_LIBPCIACCESS)
66 err = pci_device_map_range(device, pVMWARE->mmioPhysBase,
67 pVMWARE->mmioSize,
68 PCI_DEV_MAP_FLAG_WRITABLE,
69 @@ -1099,7 +1099,7 @@ VMWAREStopFIFO(ScrnInfoPtr pScrn)
70 TRACEPOINT
72 vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 0);
73 -#if XSERVER_LIBPCIACCESS
74 +#if defined(XSERVER_LIBPCIACCESS)
75 pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
76 #else
77 xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
78 diff --git a/src/vmware.h b/src/vmware.h
79 index 028dff3..58676b3 100644
80 --- a/src/vmware.h
81 +++ b/src/vmware.h
82 @@ -83,7 +83,7 @@ typedef xXineramaScreenInfo VMWAREXineramaRec, *VMWAREXineramaPtr;
84 typedef struct {
85 EntityInfoPtr pEnt;
86 -#if XSERVER_LIBPCIACCESS
87 +#if defined(XSERVER_LIBPCIACCESS)
88 struct pci_device *PciInfo;
89 #else
90 pciVideoPtr PciInfo;
91 @@ -207,7 +207,7 @@ typedef struct {
92 /* Undefine this to kill all acceleration */
93 #define ACCELERATE_OPS
95 -#if XSERVER_LIBPCIACCESS
96 +#if defined(XSERVER_LIBPCIACCESS)
97 #define VENDOR_ID(p) (p)->vendor_id
98 #define DEVICE_ID(p) (p)->device_id
99 #define SUBVENDOR_ID(p) (p)->subvendor_id
100 diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
101 index 0cfac57..efe217e 100644
102 --- a/src/vmware_bootstrap.c
103 +++ b/src/vmware_bootstrap.c
104 @@ -91,7 +91,7 @@ static char vmware_driver_name[] = VMWARE_DRIVER_NAME;
105 VMW_STRING(PACKAGE_VERSION_MAJOR) "." VMW_STRING(PACKAGE_VERSION_MINOR) \
106 "." VMW_STRING(PACKAGE_VERSION_PATCHLEVEL)
108 -#if !XSERVER_LIBPCIACCESS
109 +#ifndef XSERVER_LIBPCIACCESS
110 static const char VMWAREBuildStr[] = "VMware Guest X Server "
111 VMWARE_DRIVER_VERSION_STRING " - build=$Name$\n";
112 #else
113 @@ -127,7 +127,7 @@ static resRange vmwareLegacyRes[] = {
114 #define vmwareLegacyRes NULL
115 #endif
117 -#if XSERVER_LIBPCIACCESS
118 +#if defined(XSERVER_LIBPCIACCESS)
119 #define VENDOR_ID(p) (p)->vendor_id
120 #define DEVICE_ID(p) (p)->device_id
121 #define SUBVENDOR_ID(p) (p)->subvendor_id
122 @@ -141,7 +141,7 @@ static resRange vmwareLegacyRes[] = {
123 #define CHIP_REVISION(p) (p)->chipRev
124 #endif
126 -#if XSERVER_LIBPCIACCESS
127 +#if defined(XSERVER_LIBPCIACCESS)
129 #define VMWARE_DEVICE_MATCH(d, i) \
130 {PCI_VENDOR_ID_VMWARE, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
131 @@ -220,7 +220,7 @@ vmwgfx_hosted_detect(void);
132 static Bool
133 VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
135 -#if XSERVER_LIBPCIACCESS
136 +#if defined(XSERVER_LIBPCIACCESS)
137 struct pci_device *pciInfo;
138 #else
139 pciVideoPtr pciInfo;
140 @@ -270,7 +270,7 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
141 return (*pScrn->PreInit)(pScrn, flags);
144 -#if XSERVER_LIBPCIACCESS
145 +#if defined(XSERVER_LIBPCIACCESS)
146 static Bool
147 VMwarePciProbe (DriverPtr drv,
148 int entity_num,
149 @@ -520,7 +520,7 @@ _X_EXPORT DriverRec vmware = {
150 VMWARE_DRIVER_VERSION,
151 vmware_driver_name,
152 VMWAREIdentify,
153 -#if XSERVER_LIBPCIACCESS
154 +#if defined(XSERVER_LIBPCIACCESS)
155 NULL,
156 #else
157 VMWAREProbe,
158 @@ -532,7 +532,7 @@ _X_EXPORT DriverRec vmware = {
159 VMWareDriverFunc,
160 #endif
161 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 4
162 -#if XSERVER_LIBPCIACCESS
163 +#if defined(XSERVER_LIBPCIACCESS)
164 VMwareDeviceMatch,
165 VMwarePciProbe,
166 #else