1
0

libopenmpt_config.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. * libopenmpt_config.h
  3. * -------------------
  4. * Purpose: libopenmpt public interface configuration
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #ifndef LIBOPENMPT_CONFIG_H
  10. #define LIBOPENMPT_CONFIG_H
  11. /* clang-format off */
  12. /*! \defgroup libopenmpt libopenmpt */
  13. /*! \addtogroup libopenmpt
  14. @{
  15. */
  16. /* provoke warnings if already defined */
  17. #define LIBOPENMPT_API
  18. #undef LIBOPENMPT_API
  19. #define LIBOPENMPT_CXX_API
  20. #undef LIBOPENMPT_CXX_API
  21. /*!
  22. @}
  23. */
  24. /*! \addtogroup libopenmpt_c
  25. @{
  26. */
  27. /*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_buffer.h exists. */
  28. #define LIBOPENMPT_STREAM_CALLBACKS_BUFFER
  29. /*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_fd.h exists.
  30. * \since 0.3
  31. * \remarks
  32. * Use the following to check for availability:
  33. * \code
  34. * #include <libopenmpt/libopenmpt.h>
  35. * #if defined(LIBOPENMPT_STREAM_CALLBACKS_FD) || ((OPENMPT_API_VERSION_MAJOR == 0) && ((OPENMPT_API_VERSION_MINOR == 2) || (OPENMPT_API_VERSION_MINOR == 1)))
  36. * #include <libopenmpt/libopenmpt_stream_callbacks_fd.h>
  37. * #endif
  38. * \endcode
  39. */
  40. #define LIBOPENMPT_STREAM_CALLBACKS_FD
  41. /*! \brief Defined if libopenmpt/libopenmpt_stream_callbacks_file.h exists.
  42. * \since 0.3
  43. * \remarks
  44. * Use the following to check for availability:
  45. * \code
  46. * #include <libopenmpt/libopenmpt.h>
  47. * #if defined(LIBOPENMPT_STREAM_CALLBACKS_FILE) || ((OPENMPT_API_VERSION_MAJOR == 0) && ((OPENMPT_API_VERSION_MINOR == 2) || (OPENMPT_API_VERSION_MINOR == 1)))
  48. * #include <libopenmpt/libopenmpt_stream_callbacks_file.h>
  49. * #endif
  50. * \endcode
  51. */
  52. #define LIBOPENMPT_STREAM_CALLBACKS_FILE
  53. /*!
  54. @}
  55. */
  56. /*! \addtogroup libopenmpt
  57. @{
  58. */
  59. #if defined(__DOXYGEN__)
  60. #define LIBOPENMPT_API_HELPER_EXPORT
  61. #define LIBOPENMPT_API_HELPER_IMPORT
  62. #define LIBOPENMPT_API_HELPER_PUBLIC
  63. #define LIBOPENMPT_API_HELPER_LOCAL
  64. #elif defined(_MSC_VER)
  65. #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
  66. #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
  67. #define LIBOPENMPT_API_HELPER_PUBLIC
  68. #define LIBOPENMPT_API_HELPER_LOCAL
  69. #elif defined(__EMSCRIPTEN__)
  70. #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default"))) __attribute__((used))
  71. #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default"))) __attribute__((used))
  72. #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
  73. #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
  74. #elif (defined(__GNUC__) || defined(__clang__)) && defined(_WIN32)
  75. #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
  76. #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
  77. #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
  78. #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
  79. #elif defined(__GNUC__) || defined(__clang__)
  80. #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
  81. #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
  82. #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
  83. #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
  84. #elif defined(_WIN32)
  85. #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
  86. #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
  87. #define LIBOPENMPT_API_HELPER_PUBLIC
  88. #define LIBOPENMPT_API_HELPER_LOCAL
  89. #else
  90. #define LIBOPENMPT_API_HELPER_EXPORT
  91. #define LIBOPENMPT_API_HELPER_IMPORT
  92. #define LIBOPENMPT_API_HELPER_PUBLIC
  93. #define LIBOPENMPT_API_HELPER_LOCAL
  94. #endif
  95. #if defined(LIBOPENMPT_BUILD_DLL)
  96. #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
  97. #elif defined(LIBOPENMPT_USE_DLL)
  98. #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
  99. #else
  100. #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
  101. #endif
  102. #ifdef __cplusplus
  103. #define LIBOPENMPT_CXX_API LIBOPENMPT_API
  104. #if defined(LIBOPENMPT_USE_DLL)
  105. #if defined(_MSC_VER) && !defined(_DLL)
  106. #error "C++ interface is disabled if libopenmpt is built as a DLL and the runtime is statically linked. This is not supported by microsoft and cannot possibly work. Ever."
  107. #undef LIBOPENMPT_CXX_API
  108. #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
  109. #endif
  110. #endif
  111. #if defined(__EMSCRIPTEN__)
  112. /* Only the C API is supported for emscripten. Disable the C++ API. */
  113. #undef LIBOPENMPT_CXX_API
  114. #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
  115. #endif
  116. #endif
  117. /*!
  118. @}
  119. */
  120. /* C */
  121. #if !defined(LIBOPENMPT_NO_DEPRECATE)
  122. #if defined(__clang__)
  123. #define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
  124. #elif defined(__GNUC__)
  125. #define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
  126. #elif defined(_MSC_VER)
  127. #define LIBOPENMPT_DEPRECATED __declspec(deprecated)
  128. #else
  129. #define LIBOPENMPT_DEPRECATED
  130. #endif
  131. #else
  132. #define LIBOPENMPT_DEPRECATED
  133. #endif
  134. #ifndef __cplusplus
  135. #if !defined(LIBOPENMPT_NO_DEPRECATE)
  136. LIBOPENMPT_DEPRECATED static const int LIBOPENMPT_DEPRECATED_STRING_CONSTANT = 0;
  137. #define LIBOPENMPT_DEPRECATED_STRING( str ) ( LIBOPENMPT_DEPRECATED_STRING_CONSTANT ? ( str ) : ( str ) )
  138. #else
  139. #define LIBOPENMPT_DEPRECATED_STRING( str ) str
  140. #endif
  141. #else
  142. #define LIBOPENMPT_DEPRECATED_STRING( str ) str
  143. #endif
  144. /* C++ */
  145. #ifdef __cplusplus
  146. #if defined(LIBOPENMPT_ASSUME_CPLUSPLUS)
  147. #endif
  148. #if !defined(LIBOPENMPT_NO_DEPRECATE)
  149. #define LIBOPENMPT_ATTR_DEPRECATED [[deprecated]]
  150. #else
  151. #define LIBOPENMPT_ATTR_DEPRECATED
  152. #endif
  153. #endif
  154. /* clang-format on */
  155. #include "libopenmpt_version.h"
  156. #endif /* LIBOPENMPT_CONFIG_H */