shithub: choc

Download patch

ref: 59698770a3d731b6732e59518e51c5695f11c728
parent: b67821cd804a1c9d1d11ee5de4b00df5a0514032
parent: 2e855ffeb6b7e879603c5ccfad8b0b061999d110
author: Simon Howard <fraggle+github@gmail.com>
date: Fri Nov 6 13:42:58 EST 2015

Merge pull request #638 from rrebello/io-ports-fix

opl: limit use of ioperm/inb/outb to x86 architecture

--- a/opl/opl.c
+++ b/opl/opl.c
@@ -27,7 +27,7 @@
 
 //#define OPL_DEBUG_TRACE
 
-#ifdef HAVE_IOPERM
+#if (defined(__i386__) || defined(__x86_64__)) && defined(HAVE_IOPERM)
 extern opl_driver_t opl_linux_driver;
 #endif
 #if defined(HAVE_LIBI386) || defined(HAVE_LIBAMD64)
@@ -40,7 +40,7 @@
 
 static opl_driver_t *drivers[] =
 {
-#ifdef HAVE_IOPERM
+#if (defined(__i386__) || defined(__x86_64__)) && defined(HAVE_IOPERM)
     &opl_linux_driver,
 #endif
 #if defined(HAVE_LIBI386) || defined(HAVE_LIBAMD64)
--- a/opl/opl_linux.c
+++ b/opl/opl_linux.c
@@ -17,7 +17,7 @@
 
 #include "config.h"
 
-#ifdef HAVE_IOPERM
+#if (defined(__i386__) || defined(__x86_64__)) && defined(HAVE_IOPERM)
 
 #include <stdio.h>
 #include <string.h>
@@ -99,5 +99,5 @@
     OPL_Timer_AdjustCallbacks,
 };
 
-#endif /* #ifdef HAVE_IOPERM */
+#endif /* #if (defined(__i386__) || defined(__x86_64__)) && defined(HAVE_IOPERM) */