Load presets directly into objects
[openal-soft.git] / Alc / compat.h
blobdbbcce2807e959a738859b95070ebbea0c77a886
1 #ifndef AL_COMPAT_H
2 #define AL_COMPAT_H
4 #include "AL/al.h"
6 #ifdef _WIN32
8 #define WIN32_LEAN_AND_MEAN
9 #include <windows.h>
11 typedef DWORD althread_key_t;
12 int althread_key_create(althread_key_t *key, void (*callback)(void*));
13 int althread_key_delete(althread_key_t key);
14 void *althread_getspecific(althread_key_t key);
15 int althread_setspecific(althread_key_t key, void *val);
17 typedef LONG althread_once_t;
18 #define ALTHREAD_ONCE_INIT 0
19 void althread_once(althread_once_t *once, void (*callback)(void));
21 inline int alsched_yield(void)
22 { SwitchToThread(); return 0; }
24 WCHAR *strdupW(const WCHAR *str);
26 #define HAVE_DYNLOAD 1
28 #else
30 #include <pthread.h>
32 typedef pthread_mutex_t CRITICAL_SECTION;
33 void InitializeCriticalSection(CRITICAL_SECTION *cs);
34 void DeleteCriticalSection(CRITICAL_SECTION *cs);
35 void EnterCriticalSection(CRITICAL_SECTION *cs);
36 void LeaveCriticalSection(CRITICAL_SECTION *cs);
38 ALuint timeGetTime(void);
39 void Sleep(ALuint t);
41 #define althread_key_t pthread_key_t
42 #define althread_key_create pthread_key_create
43 #define althread_key_delete pthread_key_delete
44 #define althread_getspecific pthread_getspecific
45 #define althread_setspecific pthread_setspecific
47 #define althread_once_t pthread_once_t
48 #define ALTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
49 #define althread_once pthread_once
51 #define alsched_yield sched_yield
53 #if defined(HAVE_DLFCN_H)
54 #define HAVE_DYNLOAD 1
55 #endif
57 #endif
59 #ifdef HAVE_DYNLOAD
60 void *LoadLib(const char *name);
61 void CloseLib(void *handle);
62 void *GetSymbol(void *handle, const char *name);
63 #endif
65 #endif /* AL_COMPAT_H */