--- apmsleep.c	2003-10-13 17:40:40.000000000 +0100
+++ apmsleep.c.plasmaroo@gentoo.org	2003-10-13 17:40:27.000000000 +0100
@@ -45,13 +45,18 @@
 #include <stdio.h>
 #include <linux/version.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#include <linux/rtc.h>
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 #include <linux/spinlock.h>
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
 #include <asm/spinlock.h>
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 #include <linux/mc146818rtc.h>
+#endif
+
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/types.h>