compat.h 870 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef AL_COMPAT_H
  2. #define AL_COMPAT_H
  3. #include "alstring.h"
  4. #ifdef _WIN32
  5. #define WIN32_LEAN_AND_MEAN
  6. #include <windows.h>
  7. WCHAR *strdupW(const WCHAR *str);
  8. /* Opens a file with standard I/O. The filename is expected to be UTF-8. */
  9. FILE *al_fopen(const char *fname, const char *mode);
  10. #define HAVE_DYNLOAD 1
  11. #else
  12. #define al_fopen fopen
  13. #if defined(HAVE_DLFCN_H) && !defined(IN_IDE_PARSER)
  14. #define HAVE_DYNLOAD 1
  15. #endif
  16. #endif
  17. struct FileMapping {
  18. #ifdef _WIN32
  19. HANDLE file;
  20. HANDLE fmap;
  21. #else
  22. int fd;
  23. #endif
  24. void *ptr;
  25. size_t len;
  26. };
  27. struct FileMapping MapFileToMem(const char *fname);
  28. void UnmapFileMem(const struct FileMapping *mapping);
  29. al_string GetProcPath(void);
  30. #ifdef HAVE_DYNLOAD
  31. void *LoadLib(const char *name);
  32. void CloseLib(void *handle);
  33. void *GetSymbol(void *handle, const char *name);
  34. #endif
  35. #endif /* AL_COMPAT_H */