diff system/System.h @ 606:1415e35881f6

* Some (incomplete) Solaris build bobs
author Chris Cannam
date Thu, 10 Sep 2009 14:17:59 +0000
parents 02d9664906e8
children badbbf0921fa
line wrap: on
line diff
--- a/system/System.h	Tue Sep 08 16:53:32 2009 +0000
+++ b/system/System.h	Thu Sep 10 14:17:59 2009 +0000
@@ -21,6 +21,7 @@
 #include <windows.h>
 #include <malloc.h>
 #include <process.h>
+#include <math.h>
 
 #define MLOCK(a,b)   1
 #define MUNLOCK(a,b) 1
@@ -58,11 +59,15 @@
 int gettimeofday(struct timeval *p, void *tz);
 }
 
+#define ISNAN isnan
+#define ISINF isinf
+
 #else
 
 #include <sys/mman.h>
 #include <dlfcn.h>
 #include <stdio.h> // for perror
+#include <cmath>
 
 #define MLOCK(a,b)   ::mlock((a),(b))
 #define MUNLOCK(a,b) (::munlock((a),(b)) ? (::perror("munlock failed"), 0) : 0)
@@ -76,6 +81,10 @@
 #define DLCLOSE(a)   dlclose((a))
 #define DLERROR()    dlerror()
 
+#include <cmath>
+#define ISNAN std::isnan
+#define ISINF std::isinf
+
 #ifdef __APPLE__
 
 #define PLUGIN_GLOB  "*.dylib *.so"
@@ -88,6 +97,19 @@
 
 #else 
 
+#ifdef sun
+#undef MLOCK
+#undef MUNLOCK
+#define MLOCK(a,b) ::mlock((char *)a,b)
+#define MUNLOCK(a,b) ::munlock((char *)a,b)
+#ifdef __SUNPRO_CC
+#undef ISNAN
+#undef ISINF
+#define ISNAN(x) ((x)!=(x))
+#define ISINF(x) 0
+#endif
+#endif
+
 #define PLUGIN_GLOB  "*.so"
 #define PATH_SEPARATOR ':'