pal_platform.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "os/QNX/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_OPENHARMONY
  12. #include "os/OpenHarmony/pal_openharmony.h"
  13. #elif IL2CPP_TARGET_JAVASCRIPT
  14. #include "os/Emscripten/pal_emscripten.h"
  15. #elif IL2CPP_TARGET_SWITCH
  16. #include "pal/pal_switch.h"
  17. #elif IL2CPP_TARGET_PS4 || IL2CPP_TARGET_PS5
  18. #include "pal/pal_playstation.h"
  19. #endif
  20. /*
  21. These defines below just remap some posix function names. By default they fallback to the standard posix name but
  22. some platforms might need to define this symbols to something different in their "pal_[platform name]" header above.
  23. This is normally due to the platform not including the posix function as standard (e.g. Switch, Playstation).
  24. */
  25. #ifndef stat_
  26. #define stat_ stat
  27. #endif
  28. #ifndef fstat_
  29. #define fstat_ fstat
  30. #endif
  31. #ifndef lstat_
  32. #define lstat_ lstat
  33. #endif
  34. #ifndef utimes_
  35. #define utimes_ utimes
  36. #endif
  37. #ifndef chmod_
  38. #define chmod_ chmod
  39. #endif
  40. #ifndef link_
  41. #define link_ link
  42. #endif
  43. #ifndef symlink_
  44. #define symlink_ symlink
  45. #endif
  46. #ifndef readlink_
  47. #define readlink_ readlink
  48. #endif
  49. #ifndef geteuid_
  50. #define geteuid_ geteuid
  51. #endif
  52. #ifndef getegid_
  53. #define getegid_ getegid
  54. #endif