libopenmpt  0.6.3+release.autotools
cross-platform C++ and C library to decode tracked music files
libopenmpt_config.h
Go to the documentation of this file.
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 
10 #ifndef LIBOPENMPT_CONFIG_H
11 #define LIBOPENMPT_CONFIG_H
12 
13 /* clang-format off */
14 
21 /* provoke warnings if already defined */
22 #define LIBOPENMPT_API
23 #undef LIBOPENMPT_API
24 #define LIBOPENMPT_CXX_API
25 #undef LIBOPENMPT_CXX_API
26 
36 #define LIBOPENMPT_STREAM_CALLBACKS_BUFFER
37 
49 #define LIBOPENMPT_STREAM_CALLBACKS_FD
50 
62 #define LIBOPENMPT_STREAM_CALLBACKS_FILE
63 
72 #if defined(__DOXYGEN__)
73 
74 #define LIBOPENMPT_API_HELPER_EXPORT
75 #define LIBOPENMPT_API_HELPER_IMPORT
76 #define LIBOPENMPT_API_HELPER_PUBLIC
77 #define LIBOPENMPT_API_HELPER_LOCAL
78 
79 #elif defined(_MSC_VER)
80 
81 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
82 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
83 #define LIBOPENMPT_API_HELPER_PUBLIC
84 #define LIBOPENMPT_API_HELPER_LOCAL
85 
86 #elif defined(__EMSCRIPTEN__)
87 
88 #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default"))) __attribute__((used))
89 #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default"))) __attribute__((used))
90 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
91 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
92 
93 #elif (defined(__GNUC__) || defined(__clang__)) && defined(_WIN32)
94 
95 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
96 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
97 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
98 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
99 
100 #elif defined(__GNUC__) || defined(__clang__)
101 
102 #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
103 #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
104 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
105 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
106 
107 #elif defined(_WIN32)
108 
109 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
110 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
111 #define LIBOPENMPT_API_HELPER_PUBLIC
112 #define LIBOPENMPT_API_HELPER_LOCAL
113 
114 #else
115 
116 #define LIBOPENMPT_API_HELPER_EXPORT
117 #define LIBOPENMPT_API_HELPER_IMPORT
118 #define LIBOPENMPT_API_HELPER_PUBLIC
119 #define LIBOPENMPT_API_HELPER_LOCAL
120 
121 #endif
122 
123 #if defined(LIBOPENMPT_BUILD_DLL)
124 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
125 #elif defined(LIBOPENMPT_USE_DLL)
126 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
127 #else
128 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
129 #endif
130 
131 #ifdef __cplusplus
132 
133 #define LIBOPENMPT_CXX_API LIBOPENMPT_API
134 
135 #if defined(LIBOPENMPT_USE_DLL)
136 #if defined(_MSC_VER) && !defined(_DLL)
137 #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."
138 #undef LIBOPENMPT_CXX_API
139 #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
140 #endif
141 #endif
142 
143 #if defined(__EMSCRIPTEN__)
144 
145 /* Only the C API is supported for emscripten. Disable the C++ API. */
146 #undef LIBOPENMPT_CXX_API
147 #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
148 #endif
149 
150 #endif
151 
157 /* C */
158 
159 #if !defined(LIBOPENMPT_NO_DEPRECATE)
160 #if defined(__clang__)
161 #define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
162 #elif defined(__GNUC__)
163 #define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
164 #elif defined(_MSC_VER)
165 #define LIBOPENMPT_DEPRECATED __declspec(deprecated)
166 #else
167 #define LIBOPENMPT_DEPRECATED
168 #endif
169 #else
170 #define LIBOPENMPT_DEPRECATED
171 #endif
172 
173 #ifndef __cplusplus
174 #if !defined(LIBOPENMPT_NO_DEPRECATE)
176 #define LIBOPENMPT_DEPRECATED_STRING( str ) ( LIBOPENMPT_DEPRECATED_STRING_CONSTANT ? ( str ) : ( str ) )
177 #else
178 #define LIBOPENMPT_DEPRECATED_STRING( str ) str
179 #endif
180 #else
181 #define LIBOPENMPT_DEPRECATED_STRING( str ) str
182 #endif
183 
184 
185 /* C++ */
186 
187 #ifdef __cplusplus
188 
189 #if defined(LIBOPENMPT_ASSUME_CPLUSPLUS)
190 #endif
191 
192 #if !defined(LIBOPENMPT_NO_DEPRECATE)
193 #define LIBOPENMPT_ATTR_DEPRECATED [[deprecated]]
194 #else
195 #define LIBOPENMPT_ATTR_DEPRECATED
196 #endif
197 
198 #endif
199 
200 
201 /* clang-format on */
202 
203 #include "libopenmpt_version.h"
204 
205 #endif /* LIBOPENMPT_CONFIG_H */
#define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:167
static const int LIBOPENMPT_DEPRECATED_STRING_CONSTANT
Definition: libopenmpt_config.h:175