--- a/is_key_down.c
+++ b/is_key_down.c
@@ -35,7 +35,9 @@
 // Not MS Windows:
 #include <stdio.h>
 #include <fcntl.h>
+#ifdef __linux__
 #include <linux/ppdev.h>
+#endif
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -134,6 +136,7 @@
 // Access the parallel port
 static int open_key_pport(const char * name)
 {
+#ifdef __linux__
 	int byte;
 
 	if (fd >= 0)
@@ -152,11 +155,13 @@
 		ioctl(fd, PPWCONTROL, &byte);		
 		return 0;	// Success
 	}
+#endif
 	return -1;
 }
 
 static void close_key_pport(void)
 {
+#ifdef __linux__
 	int byte;
 
 	if (fd >= 0) {
@@ -164,6 +169,7 @@
 		ioctl(fd, PPWCONTROL, &byte);
 		close(fd);
 	}
+#endif
 	fd = -1;
 }
 
@@ -175,6 +181,7 @@
 
 static int is_key_down_pport(void)
 {
+#ifdef __linux__
 	int byte;
 
 	if (fd < 0)		// port not open
@@ -183,6 +190,7 @@
 	ioctl(fd, PPRSTATUS, &byte);
 	if (byte & 0x10)
 		return 1;	// Key is down
+#endif
 	return 0;		// Key is up
 }
 
