Fix setting Ambi formats for loopback devices
[openal-soft.git] / Alc / compat.h
blob247ed05b8980137acfc4f977adf41483843b4d7b
1 #ifndef AL_COMPAT_H
2 #define AL_COMPAT_H
4 #include "alstring.h"
6 #ifdef _WIN32
8 #define WIN32_LEAN_AND_MEAN
9 #include <windows.h>
11 WCHAR *strdupW(const WCHAR *str);
13 /* Opens a file with standard I/O. The filename is expected to be UTF-8. */
14 FILE *al_fopen(const char *fname, const char *mode);
16 #define HAVE_DYNLOAD 1
18 #else
20 #define al_fopen fopen
22 #if defined(HAVE_DLFCN_H) && !defined(IN_IDE_PARSER)
23 #define HAVE_DYNLOAD 1
24 #endif
26 #endif
28 struct FileMapping {
29 #ifdef _WIN32
30 HANDLE file;
31 HANDLE fmap;
32 #else
33 int fd;
34 #endif
35 void *ptr;
36 size_t len;
38 struct FileMapping MapFileToMem(const char *fname);
39 void UnmapFileMem(const struct FileMapping *mapping);
41 al_string GetProcPath(void);
43 #ifdef HAVE_DYNLOAD
44 void *LoadLib(const char *name);
45 void CloseLib(void *handle);
46 void *GetSymbol(void *handle, const char *name);
47 #endif
49 #ifdef __ANDROID__
50 #define JCALL(obj, func) ((*(obj))->func((obj), EXTRACT_VCALL_ARGS
51 #define JCALL0(obj, func) ((*(obj))->func((obj) EXTRACT_VCALL_ARGS
53 /** Returns a JNIEnv*. */
54 void *Android_GetJNIEnv(void);
55 #endif
57 #endif /* AL_COMPAT_H */