Use "XORG <version>" macro instead of "XORG_<version>" to distinguish between X.Org branches.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3883 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index 9a5fb40..a36e769 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -63,7 +63,7 @@
 #ifdef XKB
 #include <xkbsrv.h>
 #endif
-#ifdef XORG_16
+#if XORG >= 16
 #include "exevents.h"
 extern void
 CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
@@ -77,7 +77,7 @@
 
 static DeviceIntPtr vncKeyboardDevice = NULL;
 static DeviceIntPtr vncPointerDevice = NULL;
-#ifdef XORG_15
+#if XORG == 15
 static xEvent *eventq = NULL;
 #else
 static EventList *eventq = NULL;
@@ -194,7 +194,7 @@
   if (httpListener)
     httpServer = new FileHTTPServer(this);
 
-#ifdef XORG_15
+#if XORG == 15
   /*
    * XXX eventq is never free()-ed because it has to exist during server life
    * */
@@ -211,7 +211,7 @@
    */
   if (vncKeyboardDevice == NULL) {
     vncKeyboardDevice = AddInputDevice(
-#ifdef XORG_16
+#if XORG >= 16
 				       serverClient,
 #endif
 				       vfbKeybdProc, TRUE);
@@ -220,7 +220,7 @@
 
   if (vncPointerDevice == NULL) {
     vncPointerDevice = AddInputDevice(
-#ifdef XORG_16
+#if XORG >= 16
 				      serverClient,
 #endif
 				      vfbMouseProc, TRUE);
@@ -557,7 +557,7 @@
   if (!cursorPos.equals(oldCursorPos)) {
     oldCursorPos = cursorPos;
     (*pScreen->SetCursorPosition) (
-#ifdef XORG_16
+#if XORG >= 16
 				   vncPointerDevice,
 #endif
 				   pScreen, cursorPos.x, cursorPos.y, FALSE);
@@ -569,7 +569,7 @@
 void XserverDesktop::blockHandler(fd_set* fds)
 {
   try {
-#ifdef XORG_15
+#if XORG == 15
     ScreenPtr screenWithCursor = GetCurrentRootWindow()->drawable.pScreen;
 #else
     ScreenPtr screenWithCursor =
@@ -578,7 +578,7 @@
     if (screenWithCursor == pScreen) {
       int x, y;
       GetSpritePosition(
-#ifdef XORG_16
+#if XORG >= 16
 			vncPointerDevice,
 #endif
 			&x, &y);
@@ -742,7 +742,7 @@
   //(*pScreen->SetCursorPosition) (pScreen, pos.x, pos.y, FALSE);
 
   NewCurrentScreen(
-#ifdef XORG_16
+#if XORG >= 16
 		   vncPointerDevice,
 #endif
 		   pScreen, pos.x, pos.y);
@@ -751,7 +751,7 @@
     valuators[0] = pos.x;
     valuators[1] = pos.y;
 
-#ifdef XORG_16
+#if XORG >= 16
     GetEventList(&eventq);
 #endif
     n = GetPointerEvents (eventq, vncPointerDevice, MotionNotify, 0,
@@ -759,7 +759,7 @@
 
     for (i = 0; i < n; i++) {
       mieqEnqueue (vncPointerDevice,
-#ifdef XORG_15
+#if XORG == 15
 		   eventq + i
 #else
 		   (eventq + i)->event
@@ -779,7 +779,7 @@
 
       for (j = 0; j < n; j++) {
 	mieqEnqueue (vncPointerDevice,
-#ifdef XORG_15
+#if XORG == 15
 		     eventq + j
 #else
 		     (eventq + j)->event
@@ -809,7 +809,7 @@
   RRModePtr         mode;
 
   // Make sure all RandR tables are properly populated
-#ifdef XORG_15
+#if XORG == 15
   ret = RRGetInfo(pScreen);
 #else
   ret = RRGetInfo(pScreen, FALSE);
@@ -832,7 +832,7 @@
 
   // Then we have to call RRGetInfo again for it to copy the RandR
   // 1.0 information to the 1.2 structures.
-#ifdef XORG_15
+#if XORG == 15
   ret = RRGetInfo(pScreen);
 #else
   ret = RRGetInfo(pScreen, FALSE);
@@ -1008,7 +1008,7 @@
 			   down ? KeyPress : KeyRelease, keycode);
     for (i = 0; i < n; i++) {
       mieqEnqueue (vncKeyboardDevice,
-#ifdef XORG_15
+#if XORG == 15
 		   eventq + i
 #else
 		   (eventq + i)->event
@@ -1161,7 +1161,7 @@
 
 	vlog.info("Added unknown keysym 0x%x to keycode %d",keysym,kc);
 
-#ifdef XORG_15
+#if XORG == 15
 	master = inputInfo.keyboard;
 #else
 	master = vncKeyboardDevice->u.master;
@@ -1169,7 +1169,7 @@
 	if (vncKeyboardDevice ==
 	    dixLookupPrivate(&master->devPrivates, CoreDevicePrivateKey)) {
 	  dixSetPrivate(&master->devPrivates, CoreDevicePrivateKey, NULL);
-#ifdef XORG_15
+#if XORG == 15
 	  SwitchCoreKeyboard(vncKeyboardDevice);
 #else
 	  CopyKeyClass(vncKeyboardDevice, master);
@@ -1213,7 +1213,7 @@
 			 KeyPress : KeyRelease, kc);
   for (i = 0; i < n; i++) {
     mieqEnqueue (vncKeyboardDevice,
-#ifdef XORG_15
+#if XORG == 15
 		 eventq + i
 #else
 		 (eventq + i)->event
@@ -1492,7 +1492,7 @@
     map[4] = 4;
     map[5] = 5;
     InitPointerDeviceStruct(pDev, map, 5,
-#ifdef XORG_15
+#if XORG == 15
 			    GetMotionHistory,
 #endif
 			    (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2);
diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h
index 6777f09..b394d16 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.h
+++ b/unix/xserver/hw/vnc/XserverDesktop.h
@@ -29,10 +29,10 @@
 #if XORG_VERSION_CURRENT < \
 	((1 * 10000000) + (5 * 100000) + (99 * 1000))
 /* Xorg 1.5 branch */
-#define XORG_15
+#define XORG 15
 #else
 /* Xorg 1.6 branch */
-#define XORG_16
+#define XORG 16
 #endif
 
 #include <rfb/SDesktop.h>
diff --git a/unix/xserver/hw/vnc/vncHooks.cc b/unix/xserver/hw/vnc/vncHooks.cc
index 010e955..700efbb 100644
--- a/unix/xserver/hw/vnc/vncHooks.cc
+++ b/unix/xserver/hw/vnc/vncHooks.cc
@@ -89,7 +89,7 @@
     GCOps *wrappedOps;
 } vncHooksGCRec, *vncHooksGCPtr;
 
-#ifdef XORG_15
+#if XORG == 15
 static DevPrivateKey vncHooksScreenPrivateKey = &vncHooksScreenPrivateKey;
 static DevPrivateKey vncHooksGCPrivateKey = &vncHooksGCPrivateKey;
 #else
@@ -119,7 +119,7 @@
 static void vncHooksStoreColors(ColormapPtr pColormap, int ndef,
                                 xColorItem* pdef);
 static Bool vncHooksDisplayCursor(
-#ifdef XORG_16
+#if XORG >= 16
 				  DeviceIntPtr pDev,
 #endif
 				  ScreenPtr pScreen, CursorPtr cursor);
@@ -454,7 +454,7 @@
 // DisplayCursor - get the cursor shape
 
 static Bool vncHooksDisplayCursor(
-#ifdef XORG_16
+#if XORG >= 16
 				  DeviceIntPtr pDev,
 #endif
 				  ScreenPtr pScreen_, CursorPtr cursor)
@@ -462,11 +462,11 @@
   SCREEN_UNWRAP(pScreen_, DisplayCursor);
 
   Bool ret = (*pScreen->DisplayCursor) (
-#ifdef XORG_16
+#if XORG >= 16
 					pDev,
 #endif
 					pScreen, cursor);
-#ifdef XORG_16
+#if XORG >= 16
   /*
    * XXX DIX calls this function with NULL argument to remove cursor sprite from
    * screen. Should we handle this in setCursor as well?
@@ -474,7 +474,7 @@
   if (cursor != NullCursor) {
 #endif
     vncHooksScreen->desktop->setCursor(cursor);
-#ifdef XORG_16
+#if XORG >= 16
   }
 #endif
 
diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc
index 9fdcaf3..45820ee 100644
--- a/unix/xserver/hw/vnc/xvnc.cc
+++ b/unix/xserver/hw/vnc/xvnc.cc
@@ -736,7 +736,7 @@
 }
 
 static Bool vfbRealizeCursor(
-#ifdef XORG_16
+#if XORG >= 16
 			     DeviceIntPtr pDev,
 #endif
 			     ScreenPtr pScreen, CursorPtr pCursor) {
@@ -744,7 +744,7 @@
 }
 
 static Bool vfbUnrealizeCursor(
-#ifdef XORG_16
+#if XORG >= 16
 			       DeviceIntPtr pDev,
 #endif
 			       ScreenPtr pScreen, CursorPtr pCursor) {
@@ -752,7 +752,7 @@
 }
 
 static void vfbSetCursor(
-#ifdef XORG_16
+#if XORG >= 16
 			 DeviceIntPtr pDev,
 #endif
 			 ScreenPtr pScreen, CursorPtr pCursor, int x, int y) 
@@ -760,14 +760,14 @@
 }
 
 static void vfbMoveCursor(
-#ifdef XORG_16
+#if XORG >= 16
 			  DeviceIntPtr pDev,
 #endif
 			  ScreenPtr pScreen, int x, int y) 
 {
 }
 
-#ifdef XORG_16
+#if XORG >= 16
 static Bool
 vfbDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
 {   
@@ -785,7 +785,7 @@
     vfbUnrealizeCursor,
     vfbSetCursor,
     vfbMoveCursor
-#ifdef XORG_16
+#if XORG >= 16
     , vfbDeviceCursorInitialize,
     vfbDeviceCursorCleanup
 #endif
@@ -1303,7 +1303,7 @@
 void ProcessInputEvents()
 {
   mieqProcessInputEvents();
-#ifdef XORG_15
+#if XORG == 15
   miPointerUpdate();
 #endif
 }