pal_platform.h 1.2 KB

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