Move definition of XORG macro to separate header.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3884 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am
index 957612a..a39a10d 100644
--- a/unix/xserver/hw/vnc/Makefile.am
+++ b/unix/xserver/hw/vnc/Makefile.am
@@ -9,7 +9,7 @@
 
 noinst_LTLIBRARIES = libvnccommon.la
 
-HDRS = RegionHelper.h vncExtInit.h vncHooks.h XserverDesktop.h
+HDRS = RegionHelper.h vncExtInit.h vncHooks.h XserverDesktop.h xorg-version.h
 
 libvnccommon_la_SOURCES = $(HDRS) vncExtInit.cc vncHooks.cc XserverDesktop.cc
 
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index a36e769..d6fe993 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -41,6 +41,7 @@
 #include <rfb/Configuration.h>
 #include "XserverDesktop.h"
 #include "vncExtInit.h"
+#include "xorg-version.h"
 
 extern "C" {
 #define public c_public
diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h
index b394d16..7729d3f 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.h
+++ b/unix/xserver/hw/vnc/XserverDesktop.h
@@ -26,15 +26,6 @@
 #include <dix-config.h>
 #endif
 
-#if XORG_VERSION_CURRENT < \
-	((1 * 10000000) + (5 * 100000) + (99 * 1000))
-/* Xorg 1.5 branch */
-#define XORG 15
-#else
-/* Xorg 1.6 branch */
-#define XORG 16
-#endif
-
 #include <rfb/SDesktop.h>
 #include <rfb/HTTPServer.h>
 #include <rfb/PixelBuffer.h>
diff --git a/unix/xserver/hw/vnc/vncHooks.cc b/unix/xserver/hw/vnc/vncHooks.cc
index 700efbb..23dc4ea 100644
--- a/unix/xserver/hw/vnc/vncHooks.cc
+++ b/unix/xserver/hw/vnc/vncHooks.cc
@@ -25,6 +25,7 @@
 #include "XserverDesktop.h"
 #include "vncHooks.h"
 #include "vncExtInit.h"
+#include "xorg-version.h"
 
 extern "C" {
 #define class c_class
diff --git a/unix/xserver/hw/vnc/xorg-version.h b/unix/xserver/hw/vnc/xorg-version.h
new file mode 100644
index 0000000..e7eeca0
--- /dev/null
+++ b/unix/xserver/hw/vnc/xorg-version.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2009 TightVNC Team
+ * Copyright (C) 2009 Red Hat, Inc.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ * USA.
+ */
+
+#ifndef XORG_VERSION_H
+#define XORG_VERSION_H
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#if XORG_VERSION_CURRENT < ((1 * 10000000) + (5 * 100000) + (99 * 1000))
+#define XORG 15
+#else
+#define XORG 16
+#endif
+
+#endif
diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc
index 45820ee..05066fc 100644
--- a/unix/xserver/hw/vnc/xvnc.cc
+++ b/unix/xserver/hw/vnc/xvnc.cc
@@ -37,6 +37,7 @@
 #include <rfb/LogWriter.h>
 #include <network/TcpSocket.h>
 #include "vncExtInit.h"
+#include "xorg-version.h"
 
 extern "C" {
 #define class c_class