--- 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 + #include + #include + #if defined(__alpha__) + #include + 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 @@ -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__)