1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00
freebsd-ports/audio/mpmf20/files/patch-ab
2000-02-20 20:52:31 +00:00

44 lines
1.0 KiB
Plaintext

--- mpmf20.cpp.orig Mon Apr 12 08:49:40 1999
+++ mpmf20.cpp Fri Feb 18 10:55:01 2000
@@ -23,6 +23,24 @@
#define DELETEARRAY delete[]
#define STRICMP stricmp
+#elif defined(__FreeBSD__)
+ // FreeBSD g++
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <machine/cpufunc.h>
+ #if defined(__alpha__)
+ #include <sys/types.h>
+ extern "C" {
+ u_int8_t inb(u_int32_t);
+ void outb(u_int32_t, u_int8_t);
+ }
+ #endif
+ #define OUTPORT(p,v) outb( (p), (v) )
+ #define INPORT(p) inb( p )
+ #define CLOCK_SECOND CLOCKS_PER_SEC
+ #define DELETEARRAY delete[]
+ #define STRICMP strcasecmp
+
#elif defined(__linux__)
// linux g++
#include <unistd.h>
@@ -237,6 +255,15 @@
// init error
m_szError[ 0 ] = 0;
m_iIDError = CMPMF20_ERROR_NONE;
+
+ // if FreeBSD
+ #if defined(__FreeBSD__)
+ // request access to required ports
+ if (open("/dev/io", O_RDONLY) < 0) {
+ LogError( CMPMF20_ERROR_IOPRERM, "open(\"/dev/io\") failed, reason '%s'", SZERROR );
+ return FALSE;
+ }
+ #endif
// if linux
#if defined(__linux__)