diff --git a/src/xpdev/cpuwrap.h b/src/xpdev/cpuwrap.h
new file mode 100644
index 0000000000000000000000000000000000000000..1fa349221c640ea3a169a0f193b624277bf49a62
--- /dev/null
+++ b/src/xpdev/cpuwrap.h
@@ -0,0 +1,11 @@
+#ifdef __BIG_ENDIAN__
+#define htols(hval)	((((ushort)(hval) & 0xff00)>>8)|(((ushort)(hval) & 0x00ff)<<8))
+#define ltohs(lval)	((((ushort)(lval) & 0xff00)>>8)|(((ushort)(lval) & 0x00ff)<<8))
+#define htoll(hval)	((((ulong)(hval) & 0xff000000)>>24)|(((ulong)(hval) & 0x00ff0000)>>8)|(((ulong)(hval) & 0x0000ff00)<<8)|(((ulong)(hval) & 0x000000ff)<<24))
+#define ltohl(lval)	((((ulong)(lval) & 0xff000000)>>24)|(((ulong)(lval) & 0x00ff0000)>>8)|(((ulong)(lval) & 0x0000ff00)<<8)|(((ulong)(lval) & 0x000000ff)<<24))
+#else
+#define htols(x)	(x)
+#define ltohs(x)	(x)
+#define htoll(x)	(x)
+#define ltohl(x)	(x)
+#endif
diff --git a/src/xpdev/genwrap.c b/src/xpdev/genwrap.c
index 5ecaae91e3cc5f52eb1415f5d309d3802fedb80c..f8e7a9df97d71d6c2c30f3e0497b2ce31bfde9b4 100644
--- a/src/xpdev/genwrap.c
+++ b/src/xpdev/genwrap.c
@@ -142,6 +142,7 @@ void DLLCALL unix_beep(int freq, int dur)
 {
 	static int console_fd=-1;
 
+#if !defined(__OpenBSD__) && !defined(__GNU__) && !defined(__NetBSD__) && !defined(__QNX__)
 #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
 	int speaker_fd=-1;
 	tone_t tone;
@@ -175,6 +176,7 @@ void DLLCALL unix_beep(int freq, int dur)
 #endif /* solaris */
 	}
 #endif
+#endif /* Nasty Kludge */
 }
 #endif