Submitted By: DJ Lucas (dj_at_lucasit_dot_com)
Date: 2003-08-17
Initial Package Version: 4.3.0
Origin: DJ Lucas (dj_at_lucasit_dot_com)
Description: Fix build problem with XFree86 when building against
  2.6.x kernel headers.  
Notes:
  1) The 2.6 kernel headers are purposely not intened to be used in
  userspace at all, as previously stated on the LKML.  This patch goes
  directly against that recomendation.  This patch is intened for those
  attempting to test the possibility of 'sanitizing' the kernel headers
  per the indirect suggestions of the LKML.
  2) This patch also applies cleanly to the updated 4.3.0.1 source.

diff -Naur xc-orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c
--- xc-orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c	2002-10-20 21:45:27.000000000 +0000
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c	2003-08-17 18:33:54.000000000 +0000
@@ -73,6 +73,7 @@
 #endif
 
 /* Deal with spurious kernel header change */
+#include <linux/version.h>
 #if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
 #  define rate period
diff -Naur xc-orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c
--- xc-orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c	2003-02-17 15:11:57.000000000 +0000
+++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c	2003-08-17 18:33:54.000000000 +0000
@@ -99,6 +99,14 @@
 #include <asm/kbio.h>
 #endif
 
+/* Deal with spurious kernel header change */
+#include <linux/version.h>
+#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
+#  define rate period
+# endif
+#endif
+
 static int
 KDKBDREP_ioctl_ok(int rate, int delay) {
 #if defined(KDKBDREP) && !defined(__sparc__)
@@ -134,6 +142,10 @@
 #endif /* KDKBDREP */
 }
 
+#ifdef rate
+#undef rate
+#endif
+
 static int
 KIOCSRATE_ioctl_ok(int rate, int delay) {
 #ifdef KIOCSRATE
