openal-soft/Alc/compat.h

58 lines
955 B
C
Raw Normal View History

2013-10-28 11:26:26 -07:00
#ifndef AL_COMPAT_H
#define AL_COMPAT_H
#include "alstring.h"
2018-03-09 17:24:03 -08:00
#ifdef __cplusplus
extern "C" {
#endif
2013-10-28 11:26:26 -07:00
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
WCHAR *strdupW(const WCHAR *str);
/* Opens a file with standard I/O. The filename is expected to be UTF-8. */
FILE *al_fopen(const char *fname, const char *mode);
2013-10-28 17:48:48 -07:00
#define HAVE_DYNLOAD 1
2013-10-28 11:26:26 -07:00
#else
#define al_fopen fopen
#if defined(HAVE_DLFCN_H)
2013-10-28 11:26:26 -07:00
#define HAVE_DYNLOAD 1
2013-10-28 17:48:48 -07:00
#endif
#endif
2016-08-31 08:14:50 -07:00
struct FileMapping {
#ifdef _WIN32
HANDLE file;
HANDLE fmap;
#else
int fd;
#endif
void *ptr;
size_t len;
};
struct FileMapping MapFileToMem(const char *fname);
void UnmapFileMem(const struct FileMapping *mapping);
void GetProcBinary(al_string *path, al_string *fname);
2013-10-28 17:48:48 -07:00
#ifdef HAVE_DYNLOAD
2013-10-28 11:26:26 -07:00
void *LoadLib(const char *name);
void CloseLib(void *handle);
void *GetSymbol(void *handle, const char *name);
#endif
2018-03-09 17:24:03 -08:00
#ifdef __cplusplus
} /* extern "C" */
#endif
2013-10-28 11:26:26 -07:00
#endif /* AL_COMPAT_H */