summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-10-07 12:45:00 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-10-07 12:47:05 -0700
commit6272e69d8519c43293192b48ff39c8b3a84635d3 (patch)
tree7db85c627d04df2f31f9c9886eb58129ee083105
parentdc6d77656d14853b462a8792007e73c5dc07a4b1 (diff)
Fix build failures with recent server changes to swapl and swaps
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--src/sisusb.h8
-rw-r--r--src/sisusb_utility.c40
2 files changed, 28 insertions, 20 deletions
diff --git a/src/sisusb.h b/src/sisusb.h
index fbbebc5..1036d42 100644
--- a/src/sisusb.h
+++ b/src/sisusb.h
@@ -113,6 +113,14 @@
#include <X11/extensions/Xv.h>
#endif
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
+#define _swapl(x, n) swapl(x,n)
+#define _swaps(x, n) swaps(x,n)
+#else
+#define _swapl(x, n) swapl(x)
+#define _swaps(x, n) swaps(x)
+#endif
+
/* Platform/architecture related definitions: */
#undef SIS_PC_PLATFORM
diff --git a/src/sisusb_utility.c b/src/sisusb_utility.c
index 282f372..a9c1ee1 100644
--- a/src/sisusb_utility.c
+++ b/src/sisusb_utility.c
@@ -787,10 +787,10 @@ SiSUSBProcSiSCtrlQueryVersion(ClientPtr client)
rep.majorVersion = SISCTRL_MAJOR_VERSION;
rep.minorVersion = SISCTRL_MINOR_VERSION;
if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
+ _swaps(&rep.sequenceNumber, n);
+ _swapl(&rep.length, n);
+ _swaps(&rep.majorVersion, n);
+ _swaps(&rep.minorVersion, n);
}
WriteToClient(client, sizeof(xSiSCtrlQueryVersionReply), (char *)&rep);
return (client->noClientException);
@@ -832,15 +832,15 @@ SiSUSBProcSiSCtrlCommand(ClientPtr client)
rep.sequenceNumber = client->sequence;
if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.screen, n);
- swapl(&rep.sdc_id, n);
- swapl(&rep.sdc_command, n);
- swapl(&rep.sdc_result_header, n);
+ _swaps(&rep.sequenceNumber, n);
+ _swapl(&rep.length, n);
+ _swapl(&rep.screen, n);
+ _swapl(&rep.sdc_id, n);
+ _swapl(&rep.sdc_command, n);
+ _swapl(&rep.sdc_result_header, n);
for(i = 0; i < SDC_NUM_PARM_RESULT; i++) {
- swapl(&rep.sdc_parm[i], n);
- swapl(&rep.sdc_result[i], n);
+ _swapl(&rep.sdc_parm[i], n);
+ _swapl(&rep.sdc_result[i], n);
}
}
WriteToClient(client, sizeof(xSiSCtrlCommandReply), (char *)&rep);
@@ -867,7 +867,7 @@ SiSUSBSProcSiSCtrlQueryVersion(ClientPtr client)
{
REQUEST(xSiSCtrlQueryVersionReq);
register int n;
- swaps(&stuff->length, n);
+ _swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xSiSCtrlQueryVersionReq);
return SiSUSBProcSiSCtrlQueryVersion(client);
}
@@ -878,14 +878,14 @@ SiSUSBSProcSiSCtrlCommand(ClientPtr client)
REQUEST(xSiSCtrlCommandReq);
register int n;
int i;
- swaps(&stuff->length, n);
- swapl(&stuff->screen, n);
- swapl(&stuff->sdc_id, n);
- swapl(&stuff->sdc_command, n);
- swapl(&stuff->sdc_result_header, n);
+ _swaps(&stuff->length, n);
+ _swapl(&stuff->screen, n);
+ _swapl(&stuff->sdc_id, n);
+ _swapl(&stuff->sdc_command, n);
+ _swapl(&stuff->sdc_result_header, n);
for(i = 0; i < SDC_NUM_PARM_RESULT; i++) {
- swapl(&stuff->sdc_parm[i], n);
- swapl(&stuff->sdc_result[i], n);
+ _swapl(&stuff->sdc_parm[i], n);
+ _swapl(&stuff->sdc_result[i], n);
}
REQUEST_SIZE_MATCH(xSiSCtrlCommandReq);
return SiSUSBProcSiSCtrlCommand(client);