comparison base/System.h @ 0:da6937383da8

initial import
author Chris Cannam
date Tue, 10 Jan 2006 16:33:16 +0000
parents
children d86891498eef
comparison
equal deleted inserted replaced
-1:000000000000 0:da6937383da8
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 A waveform viewer and audio annotation editor.
5 Chris Cannam, Queen Mary University of London, 2005
6
7 This is experimental software. Not for distribution.
8 */
9
10 #ifndef _SYSTEM_H_
11 #define _SYSTEM_H_
12
13 #ifdef _WIN32
14
15 #include <windows.h>
16 #include <malloc.h>
17
18 #define MLOCK(a,b) 1
19 #define MUNLOCK(a,b) 1
20
21 #define DLOPEN(a,b) LoadLibrary((a).toStdWString().c_str())
22 #define DLSYM(a,b) GetProcAddress((HINSTANCE)(a),(b))
23 #define DLCLOSE(a) FreeLibrary((HINSTANCE)(a))
24 #define DLERROR() ""
25
26 #define PLUGIN_GLOB "*.dll"
27
28 extern "C" {
29 void gettimeofday(struct timeval *p, void *tz);
30 }
31
32 #else
33
34 #include <sys/mman.h>
35 #include <dlfcn.h>
36
37 #define MLOCK(a,b) ::mlock((a),(b))
38 #define MUNLOCK(a,b) ::munlock((a),(b))
39
40 #define DLOPEN(a,b) dlopen((a).toStdString().c_str(),(b))
41 #define DLSYM(a,b) dlsym((a),(b))
42 #define DLCLOSE(a) dlclose((a))
43 #define DLERROR() dlerror()
44
45 #define PLUGIN_GLOB "*.so"
46
47 #endif
48
49 #endif
50