comparison 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
comparison
equal deleted inserted replaced
605:133418f4e74c 606:1415e35881f6
19 #ifdef _WIN32 19 #ifdef _WIN32
20 20
21 #include <windows.h> 21 #include <windows.h>
22 #include <malloc.h> 22 #include <malloc.h>
23 #include <process.h> 23 #include <process.h>
24 #include <math.h>
24 25
25 #define MLOCK(a,b) 1 26 #define MLOCK(a,b) 1
26 #define MUNLOCK(a,b) 1 27 #define MUNLOCK(a,b) 1
27 #define MUNLOCK_SAMPLEBLOCK(a) 1 28 #define MUNLOCK_SAMPLEBLOCK(a) 1
28 #define MUNLOCKALL() 1 29 #define MUNLOCKALL() 1
56 extern "C" { 57 extern "C" {
57 void usleep(unsigned long usec); 58 void usleep(unsigned long usec);
58 int gettimeofday(struct timeval *p, void *tz); 59 int gettimeofday(struct timeval *p, void *tz);
59 } 60 }
60 61
62 #define ISNAN isnan
63 #define ISINF isinf
64
61 #else 65 #else
62 66
63 #include <sys/mman.h> 67 #include <sys/mman.h>
64 #include <dlfcn.h> 68 #include <dlfcn.h>
65 #include <stdio.h> // for perror 69 #include <stdio.h> // for perror
70 #include <cmath>
66 71
67 #define MLOCK(a,b) ::mlock((a),(b)) 72 #define MLOCK(a,b) ::mlock((a),(b))
68 #define MUNLOCK(a,b) (::munlock((a),(b)) ? (::perror("munlock failed"), 0) : 0) 73 #define MUNLOCK(a,b) (::munlock((a),(b)) ? (::perror("munlock failed"), 0) : 0)
69 #define MUNLOCK_SAMPLEBLOCK(a) do { if (!(a).empty()) { const float &b = *(a).begin(); MUNLOCK(&b, (a).capacity() * sizeof(float)); } } while(0); 74 #define MUNLOCK_SAMPLEBLOCK(a) do { if (!(a).empty()) { const float &b = *(a).begin(); MUNLOCK(&b, (a).capacity() * sizeof(float)); } } while(0);
70 //#define MLOCK(a,b) 1 75 //#define MLOCK(a,b) 1
74 #define DLOPEN(a,b) dlopen((a).toStdString().c_str(),(b)) 79 #define DLOPEN(a,b) dlopen((a).toStdString().c_str(),(b))
75 #define DLSYM(a,b) dlsym((a),(b)) 80 #define DLSYM(a,b) dlsym((a),(b))
76 #define DLCLOSE(a) dlclose((a)) 81 #define DLCLOSE(a) dlclose((a))
77 #define DLERROR() dlerror() 82 #define DLERROR() dlerror()
78 83
84 #include <cmath>
85 #define ISNAN std::isnan
86 #define ISINF std::isinf
87
79 #ifdef __APPLE__ 88 #ifdef __APPLE__
80 89
81 #define PLUGIN_GLOB "*.dylib *.so" 90 #define PLUGIN_GLOB "*.dylib *.so"
82 #define PATH_SEPARATOR ':' 91 #define PATH_SEPARATOR ':'
83 92
85 #define DEFAULT_DSSI_PATH "$HOME/Library/Audio/Plug-Ins/DSSI:/Library/Audio/Plug-Ins/DSSI" 94 #define DEFAULT_DSSI_PATH "$HOME/Library/Audio/Plug-Ins/DSSI:/Library/Audio/Plug-Ins/DSSI"
86 95
87 #define MUNLOCKALL() 1 96 #define MUNLOCKALL() 1
88 97
89 #else 98 #else
99
100 #ifdef sun
101 #undef MLOCK
102 #undef MUNLOCK
103 #define MLOCK(a,b) ::mlock((char *)a,b)
104 #define MUNLOCK(a,b) ::munlock((char *)a,b)
105 #ifdef __SUNPRO_CC
106 #undef ISNAN
107 #undef ISINF
108 #define ISNAN(x) ((x)!=(x))
109 #define ISINF(x) 0
110 #endif
111 #endif
90 112
91 #define PLUGIN_GLOB "*.so" 113 #define PLUGIN_GLOB "*.so"
92 #define PATH_SEPARATOR ':' 114 #define PATH_SEPARATOR ':'
93 115
94 #define DEFAULT_LADSPA_PATH "$HOME/ladspa:$HOME/.ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa" 116 #define DEFAULT_LADSPA_PATH "$HOME/ladspa:$HOME/.ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa"