NativeConfig.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. #ifndef OPENMPT_WNESUPPORT_CONFIG_H
  2. #define OPENMPT_WNESUPPORT_CONFIG_H
  3. #include <stdint.h>
  4. #if defined(__DOXYGEN__)
  5. #define OPENMPT_API_HELPER_EXPORT
  6. #define OPENMPT_API_HELPER_IMPORT
  7. #define OPENMPT_API_HELPER_PUBLIC
  8. #define OPENMPT_API_HELPER_LOCAL
  9. #elif defined(MPT_WINEGCC)
  10. #define OPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
  11. #define OPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
  12. #define OPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
  13. #define OPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
  14. #elif defined(_MSC_VER)
  15. #define OPENMPT_API_HELPER_EXPORT __declspec(dllexport)
  16. #define OPENMPT_API_HELPER_IMPORT __declspec(dllimport)
  17. #define OPENMPT_API_HELPER_PUBLIC
  18. #define OPENMPT_API_HELPER_LOCAL
  19. #elif defined(__GNUC__) || defined(__clang__)
  20. #define OPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
  21. #define OPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
  22. #define OPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
  23. #define OPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
  24. #else
  25. #define OPENMPT_API_HELPER_EXPORT
  26. #define OPENMPT_API_HELPER_IMPORT
  27. #define OPENMPT_API_HELPER_PUBLIC
  28. #define OPENMPT_API_HELPER_LOCAL
  29. #endif
  30. #if defined(__DOXYGEN__)
  31. #define OPENMPT_API_WINE_MS_CDECL
  32. #define OPENMPT_API_WINE_MS_STDCALL
  33. #define OPENMPT_API_WINE_MS_FASTCALL
  34. #define OPENMPT_API_WINE_MS_THISCALL
  35. #undef OPENMPT_API_WINE_SYSV
  36. #elif defined(MPT_WINEGCC)
  37. #ifdef _WIN64
  38. #define OPENMPT_API_WINE_MS_CDECL __attribute__((ms_abi))
  39. #define OPENMPT_API_WINE_MS_STDCALL __attribute__((ms_abi))
  40. #define OPENMPT_API_WINE_MS_FASTCALL __attribute__((ms_abi))
  41. #define OPENMPT_API_WINE_MS_THISCALL __attribute__((ms_abi))
  42. #else
  43. // winegcc on Ubuntu 16.04, wine-development 1.9.6 completely explodes in
  44. // incomprehensible ways while parsing __attribute__((cdecl)).
  45. #if defined(__cdecl)
  46. #define OPENMPT_API_WINE_MS_CDECL __attribute__((ms_abi)) __cdecl
  47. #else
  48. #define OPENMPT_API_WINE_MS_CDECL __attribute__((ms_abi)) __attribute__((cdecl))
  49. #endif
  50. #if defined(__stdcall)
  51. #define OPENMPT_API_WINE_MS_STDCALL __attribute__((ms_abi)) __stdcall
  52. #else
  53. #define OPENMPT_API_WINE_MS_STDCALL __attribute__((ms_abi)) __attribute__((stdcall))
  54. #endif
  55. #if defined(__fastcall)
  56. #define OPENMPT_API_WINE_MS_FASTCALL __attribute__((ms_abi)) __fastcall
  57. #else
  58. #define OPENMPT_API_WINE_MS_FASTCALL __attribute__((ms_abi)) __attribute__((fastcall))
  59. #endif
  60. #if defined(__thiscall)
  61. #define OPENMPT_API_WINE_MS_THISCALL __attribute__((ms_abi)) __thiscall
  62. #else
  63. #define OPENMPT_API_WINE_MS_THISCALL __attribute__((ms_abi)) __attribute__((thiscall))
  64. #endif
  65. #endif
  66. #define OPENMPT_API_WINE_SYSV __attribute__((sysv_abi))
  67. #elif defined(_MSC_VER)
  68. #define OPENMPT_API_WINE_MS_CDECL __cdecl
  69. #define OPENMPT_API_WINE_MS_STDCALL __stdcall
  70. #define OPENMPT_API_WINE_MS_FASTCALL __fastcall
  71. #define OPENMPT_API_WINE_MS_THISCALL __thiscall
  72. #undef OPENMPT_API_WINE_SYSV
  73. #elif defined(__GNUC__) || defined(__clang__)
  74. #ifdef _WIN64
  75. #define OPENMPT_API_WINE_MS_CDECL __attribute__((ms_abi))
  76. #define OPENMPT_API_WINE_MS_STDCALL __attribute__((ms_abi))
  77. #define OPENMPT_API_WINE_MS_FASTCALL __attribute__((ms_abi))
  78. #define OPENMPT_API_WINE_MS_THISCALL __attribute__((ms_abi))
  79. #else
  80. // winegcc on Ubuntu 16.04, wine-development 1.9.6 completely explodes in
  81. // incomprehensible ways while parsing __attribute__((cdecl)).
  82. #if defined(__cdecl)
  83. #define OPENMPT_API_WINE_MS_CDECL __attribute__((ms_abi)) __cdecl
  84. #else
  85. #define OPENMPT_API_WINE_MS_CDECL __attribute__((ms_abi)) __attribute__((cdecl))
  86. #endif
  87. #if defined(__stdcall)
  88. #define OPENMPT_API_WINE_MS_STDCALL __attribute__((ms_abi)) __stdcall
  89. #else
  90. #define OPENMPT_API_WINE_MS_STDCALL __attribute__((ms_abi)) __attribute__((stdcall))
  91. #endif
  92. #if defined(__fastcall)
  93. #define OPENMPT_API_WINE_MS_FASTCALL __attribute__((ms_abi)) __fastcall
  94. #else
  95. #define OPENMPT_API_WINE_MS_FASTCALL __attribute__((ms_abi)) __attribute__((fastcall))
  96. #endif
  97. #if defined(__thiscall)
  98. #define OPENMPT_API_WINE_MS_THISCALL __attribute__((ms_abi)) __thiscall
  99. #else
  100. #define OPENMPT_API_WINE_MS_THISCALL __attribute__((ms_abi)) __attribute__((thiscall))
  101. #endif
  102. #endif
  103. #define OPENMPT_API_WINE_SYSV __attribute__((sysv_abi))
  104. #endif
  105. #if defined(MODPLUG_TRACKER) && (!(defined(MPT_BUILD_WINESUPPORT) || defined(MPT_BUILD_WINESUPPORT_WRAPPER)))
  106. #define OPENMPT_WINESUPPORT_API
  107. #define OPENMPT_WINESUPPORT_CALL
  108. #define OPENMPT_WINESUPPORT_WRAPPER_API
  109. #define OPENMPT_WINESUPPORT_WRAPPER_CALL
  110. #else
  111. #if defined(__DOXYGEN__)
  112. #define OPENMPT_WINESUPPORT_CALL OPENMPT_API_WINE_SYSV
  113. #elif defined(MPT_WINEGCC)
  114. #define OPENMPT_WINESUPPORT_CALL OPENMPT_API_WINE_SYSV
  115. #elif defined(_MSC_VER)
  116. #define OPENMPT_WINESUPPORT_CALL OPENMPT_API_WINE_MS_CDECL
  117. #elif defined(__GNUC__) || defined(__clang__)
  118. #define OPENMPT_WINESUPPORT_CALL OPENMPT_API_WINE_SYSV
  119. #endif
  120. #define OPENMPT_WINESUPPORT_WRAPPER_CALL OPENMPT_API_WINE_MS_CDECL
  121. #if defined(MPT_BUILD_WINESUPPORT)
  122. #define OPENMPT_WINESUPPORT_API OPENMPT_API_HELPER_EXPORT
  123. #else
  124. #define OPENMPT_WINESUPPORT_API OPENMPT_API_HELPER_IMPORT
  125. #endif
  126. #if defined(MPT_BUILD_WINESUPPORT_WRAPPER)
  127. #define OPENMPT_WINESUPPORT_WRAPPER_API OPENMPT_API_HELPER_EXPORT
  128. #else
  129. #define OPENMPT_WINESUPPORT_WRAPPER_API OPENMPT_API_HELPER_IMPORT
  130. #endif
  131. #endif
  132. #endif // OPENMPT_WNESUPPORT_CONFIG_H