aboutsummaryrefslogtreecommitdiffstats
path: root/main/xf86-video-vmware/fix-old-cpp-macros.patch
blob: ac05a818c7e239d09bc8691fd22e4fd6c85110e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
Upstream: no (Too lazy)
Reason: newer GCC don't work with these macros

diff --git a/src/vmware.c b/src/vmware.c
index bd8ec37..1bc1fac 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -341,7 +341,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
            SVGA_LEGACY_BASE_PORT + SVGA_VALUE_PORT*sizeof(uint32);
     } else {
         /* Note:  This setting of valueReg causes unaligned I/O */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
         pVMWARE->portIOBase = pVMWARE->PciInfo->regions[0].base_addr;
 #else
         pVMWARE->portIOBase = pVMWARE->PciInfo->ioBase[0];
@@ -383,7 +383,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
     }
     pVMWARE->suspensionSavedRegId = id;
 
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
     pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device,
                              pVMWARE->PciInfo->func);
 #endif
@@ -727,13 +727,13 @@ static Bool
 VMWAREMapMem(ScrnInfoPtr pScrn)
 {
     VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     int err;
     struct pci_device *const device = pVMWARE->PciInfo;
     void *fbBase;
 #endif
 
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
    err = pci_device_map_range(device,
                               pVMWARE->memPhysBase,
                               pVMWARE->videoRam,
@@ -770,7 +770,7 @@ VMWAREUnmapMem(ScrnInfoPtr pScrn)
 
     VmwareLog(("Unmapped: %p/%u\n", pVMWARE->FbBase, pVMWARE->videoRam));
 
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->FbBase, pVMWARE->videoRam);
 #else
     xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->FbBase, pVMWARE->videoRam);
@@ -1045,7 +1045,7 @@ static void
 VMWAREInitFIFO(ScrnInfoPtr pScrn)
 {
     VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device *const device = pVMWARE->PciInfo;
     int err;
     void *mmioVirtBase;
@@ -1058,7 +1058,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn)
 
     pVMWARE->mmioPhysBase = vmwareReadReg(pVMWARE, SVGA_REG_MEM_START);
     pVMWARE->mmioSize = vmwareReadReg(pVMWARE, SVGA_REG_MEM_SIZE) & ~3;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     err = pci_device_map_range(device, pVMWARE->mmioPhysBase,
                                pVMWARE->mmioSize,
                                PCI_DEV_MAP_FLAG_WRITABLE,
@@ -1099,7 +1099,7 @@ VMWAREStopFIFO(ScrnInfoPtr pScrn)
     TRACEPOINT
 
     vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 0);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
 #else
     xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
diff --git a/src/vmware.h b/src/vmware.h
index 028dff3..58676b3 100644
--- a/src/vmware.h
+++ b/src/vmware.h
@@ -83,7 +83,7 @@ typedef xXineramaScreenInfo VMWAREXineramaRec, *VMWAREXineramaPtr;
 
 typedef struct {
     EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device *PciInfo;
 #else
     pciVideoPtr PciInfo;
@@ -207,7 +207,7 @@ typedef struct {
 /* Undefine this to kill all acceleration */
 #define ACCELERATE_OPS
 
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 #define VENDOR_ID(p)      (p)->vendor_id
 #define DEVICE_ID(p)      (p)->device_id
 #define SUBVENDOR_ID(p)   (p)->subvendor_id
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index 0cfac57..efe217e 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -91,7 +91,7 @@ static char vmware_driver_name[] = VMWARE_DRIVER_NAME;
     VMW_STRING(PACKAGE_VERSION_MAJOR) "." VMW_STRING(PACKAGE_VERSION_MINOR) \
     "." VMW_STRING(PACKAGE_VERSION_PATCHLEVEL)
 
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
 static const char VMWAREBuildStr[] = "VMware Guest X Server "
     VMWARE_DRIVER_VERSION_STRING " - build=$Name$\n";
 #else
@@ -127,7 +127,7 @@ static resRange vmwareLegacyRes[] = {
 #define vmwareLegacyRes NULL
 #endif
 
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 #define VENDOR_ID(p)      (p)->vendor_id
 #define DEVICE_ID(p)      (p)->device_id
 #define SUBVENDOR_ID(p)   (p)->subvendor_id
@@ -141,7 +141,7 @@ static resRange vmwareLegacyRes[] = {
 #define CHIP_REVISION(p)  (p)->chipRev
 #endif
 
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 
 #define VMWARE_DEVICE_MATCH(d, i) \
     {PCI_VENDOR_ID_VMWARE, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
@@ -220,7 +220,7 @@ vmwgfx_hosted_detect(void);
 static Bool
 VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
 {
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device *pciInfo;
 #else
     pciVideoPtr pciInfo;
@@ -270,7 +270,7 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
     return (*pScrn->PreInit)(pScrn, flags);
 };
 
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 static Bool
 VMwarePciProbe (DriverPtr           drv,
                 int                 entity_num,
@@ -520,7 +520,7 @@ _X_EXPORT DriverRec vmware = {
     VMWARE_DRIVER_VERSION,
     vmware_driver_name,
     VMWAREIdentify,
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     NULL,
 #else
     VMWAREProbe,
@@ -532,7 +532,7 @@ _X_EXPORT DriverRec vmware = {
     VMWareDriverFunc,
 #endif
 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 4
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     VMwareDeviceMatch,
     VMwarePciProbe,
 #else