pal_platform.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #if IL2CPP_TARGET_LINUX
  4. #include "os/Linux/pal_linux.h"
  5. #elif IL2CPP_TARGET_QNX
  6. #include "pal/pal_qnx.h"
  7. #elif IL2CPP_TARGET_DARWIN
  8. #include "os/OSX/pal_darwin.h"
  9. #elif IL2CPP_TARGET_ANDROID
  10. #include "os/Android/pal_android.h"
  11. #elif IL2CPP_TARGET_JAVASCRIPT
  12. #include "os/Emscripten/pal_emscripten.h"
  13. #elif IL2CPP_TARGET_SWITCH
  14. #include "pal/pal_switch.h"
  15. #elif IL2CPP_TARGET_PS4 || IL2CPP_TARGET_PS5
  16. #include "pal/pal_playstation.h"
  17. #endif
  18. /*
  19. These defines below just remap some posix function names. By default they fallback to the standard posix name but
  20. some platforms might need to define this symbols to something different in their "pal_[platform name]" header above.
  21. This is normally due to the platform not including the posix function as standard (e.g. Switch, Playstation).
  22. */
  23. #ifndef stat_
  24. #define stat_ stat
  25. #endif
  26. #ifndef fstat_
  27. #define fstat_ fstat
  28. #endif
  29. #ifndef lstat_
  30. #define lstat_ lstat
  31. #endif
  32. #ifndef utimes_
  33. #define utimes_ utimes
  34. #endif
  35. #ifndef chmod_
  36. #define chmod_ chmod
  37. #endif
  38. #ifndef link_
  39. #define link_ link
  40. #endif
  41. #ifndef symlink_
  42. #define symlink_ symlink
  43. #endif
  44. #ifndef readlink_
  45. #define readlink_ readlink
  46. #endif
  47. #ifndef geteuid_
  48. #define geteuid_ geteuid
  49. #endif
  50. #ifndef getegid_
  51. #define getegid_ getegid
  52. #endif