diff --git a/MultiSource/Applications/CMakeLists.txt b/MultiSource/Applications/CMakeLists.txt --- a/MultiSource/Applications/CMakeLists.txt +++ b/MultiSource/Applications/CMakeLists.txt @@ -1,4 +1,7 @@ -add_subdirectory(JM) +if(NOT TARGET_OS STREQUAL "OpenBSD") + add_subdirectory(JM) +endif() + add_subdirectory(SIBsim4) add_subdirectory(aha) add_subdirectory(d) diff --git a/MultiSource/Applications/SPASS/clock.h b/MultiSource/Applications/SPASS/clock.h --- a/MultiSource/Applications/SPASS/clock.h +++ b/MultiSource/Applications/SPASS/clock.h @@ -49,7 +49,9 @@ #include "misc.h" #include +#ifndef CLOCK_NO_TIMING #include +#endif typedef enum { clock_BACKTRACK, @@ -61,7 +63,9 @@ clock_TYPESIZE } CLOCK_CLOCKS; +#ifndef CLOCK_NO_TIMING typedef struct timeb CLOCK_TMS; +#endif void clock_Init(void); void clock_InitCounter(CLOCK_CLOCKS); diff --git a/MultiSource/Applications/SPASS/clock.c b/MultiSource/Applications/SPASS/clock.c --- a/MultiSource/Applications/SPASS/clock.c +++ b/MultiSource/Applications/SPASS/clock.c @@ -53,7 +53,9 @@ /**************************************************************/ float clock_Akku[clock_TYPESIZE]; +#ifndef CLOCK_NO_TIMING CLOCK_TMS clock_Counters[clock_TYPESIZE]; +#endif #ifdef WIN float clock_Ping; diff --git a/MultiSource/Applications/minisat/Main.cpp b/MultiSource/Applications/minisat/Main.cpp --- a/MultiSource/Applications/minisat/Main.cpp +++ b/MultiSource/Applications/minisat/Main.cpp @@ -65,7 +65,7 @@ static inline uint64_t memUsed() { return (uint64_t)memReadStat(0) * (uint64_t)getpagesize(); } -#elif defined(__FreeBSD__) || defined(__NetBSD__) +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) static inline uint64_t memUsed(void) { struct rusage ru; getrusage(RUSAGE_SELF, &ru); diff --git a/MultiSource/Benchmarks/MiBench/office-ispell/term.c b/MultiSource/Benchmarks/MiBench/office-ispell/term.c --- a/MultiSource/Benchmarks/MiBench/office-ispell/term.c +++ b/MultiSource/Benchmarks/MiBench/office-ispell/term.c @@ -76,8 +76,9 @@ #include "msgs.h" #include -#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || (defined(__sun__) && defined(__svr4__)) -/* Use termios under at least glibc */ +#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ + defined(__OpenBSD__) || defined(__APPLE__) || \ + (defined(__sun__) && defined(__svr4__)) #include #define USE_TERMIOS #ifndef USG diff --git a/SingleSource/Benchmarks/Misc/oourafft.c b/SingleSource/Benchmarks/Misc/oourafft.c --- a/SingleSource/Benchmarks/Misc/oourafft.c +++ b/SingleSource/Benchmarks/Misc/oourafft.c @@ -2,7 +2,9 @@ #include #include #include -#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(_AIX) // memalign +/* memalign */ +#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \ + !defined(__OpenBSD__) && !defined(_AIX) #include #endif @@ -37,7 +39,9 @@ t_overhead = t_end - t_start; /* Prepare aux data */ -#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(_AIX) /* Darwin always 16-byte aligns malloc data */ + /* Darwin always 16-byte aligns malloc data */ +#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \ + !defined(__OpenBSD__) && !defined(_AIX) ip = memalign(16, sqrt(N)*sizeof(int)); w = memalign(16, 2*N*5/4*sizeof(double)); #else @@ -47,7 +51,9 @@ makewt(N >> 1, ip, w); /* Allocate buffers */ -#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(_AIX) /* Darwin always 16-byte aligns malloc data */ + /* Darwin always 16-byte aligns malloc data */ +#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \ + !defined(__OpenBSD__) && !defined(_AIX) ref = memalign(16, 2*N*sizeof(double)); cmp = memalign(16, 2*N*sizeof(double)); src = memalign(16, 2*N*sizeof(double)); @@ -188,8 +194,6 @@ /* -------- initializing routines -------- */ -#include - void makewt(int nw, int *ip, double *w) { int j, nwh; diff --git a/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c b/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c --- a/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c +++ b/SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls.c @@ -79,6 +79,11 @@ #define ffsl ffs64 #endif +/* XXX */ +#if defined(__OpenBSD__) +#define ffsl ffs +#endif + int i; int main(void) { long long l;