il2cpp-config-api.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "os/c-api/il2cpp-config-platforms.h"
  3. #include "os/c-api/il2cpp-config-api-platforms.h"
  4. #include "il2cpp-api-types.h"
  5. // If the platform loads il2cpp as a dynamic library but does not have dlsym (or equivalent) then
  6. // define IL2CPP_API_DYNAMIC_NO_DLSYM = 1 to add support for api function registration and symbol
  7. // lookup APIs, see il2cpp-api.cpp
  8. #ifndef IL2CPP_API_DYNAMIC_NO_DLSYM
  9. #define IL2CPP_API_DYNAMIC_NO_DLSYM 0
  10. #endif
  11. /* Profiler */
  12. #ifndef IL2CPP_ENABLE_PROFILER
  13. #define IL2CPP_ENABLE_PROFILER !IL2CPP_TINY
  14. #endif
  15. #if IL2CPP_TARGET_ARMV7
  16. // On ARMv7 with Thumb instructions the lowest bit is always set.
  17. // With Thumb2 the second-to-lowest bit is also set. Mask both of
  18. // them off so that we can do a comparison properly based on the data
  19. // from the linker map file.
  20. #define IL2CPP_POINTER_SPARE_BITS 3
  21. #else
  22. // Some compilers align functions by default (MSVC), some do not (GCC).
  23. // Do not mask bits on platforms that do not absolutely require it.
  24. #define IL2CPP_POINTER_SPARE_BITS 0
  25. #endif
  26. #if IL2CPP_COMPILER_MSVC || defined(__ARMCC_VERSION)
  27. #define NORETURN __declspec(noreturn)
  28. #elif (IL2CPP_POINTER_SPARE_BITS == 0) && (defined(__clang__) || defined(__GNUC__))
  29. #define NORETURN __attribute__ ((noreturn))
  30. #else
  31. #define NORETURN
  32. #endif
  33. #if IL2CPP_TARGET_IOS || IL2CPP_TARGET_ANDROID || IL2CPP_TARGET_DARWIN
  34. #define REAL_NORETURN __attribute__ ((noreturn))
  35. #else
  36. #define REAL_NORETURN NORETURN
  37. #endif