libopenmpt  0.7.0-pre.5+r16987
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 
45 #define LIBOPENMPT_STREAM_CALLBACKS_BUFFER
46 
58 #define LIBOPENMPT_STREAM_CALLBACKS_FD
59 
71 #define LIBOPENMPT_STREAM_CALLBACKS_FILE
72 
86 #define LIBOPENMPT_STREAM_CALLBACKS_FILE_MINGW
87 
101 #define LIBOPENMPT_STREAM_CALLBACKS_FILE_MSVCRT
102 
116 #define LIBOPENMPT_STREAM_CALLBACKS_FILE_POSIX
117 
131 #define LIBOPENMPT_STREAM_CALLBACKS_FILE_POSIX_LFS64
132 
141 #if defined(__DOXYGEN__)
142 
143 #define LIBOPENMPT_API_HELPER_EXPORT
144 #define LIBOPENMPT_API_HELPER_IMPORT
145 #define LIBOPENMPT_API_HELPER_PUBLIC
146 #define LIBOPENMPT_API_HELPER_LOCAL
147 
148 #elif defined(_MSC_VER)
149 
150 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
151 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
152 #define LIBOPENMPT_API_HELPER_PUBLIC
153 #define LIBOPENMPT_API_HELPER_LOCAL
154 
155 #elif defined(__EMSCRIPTEN__)
156 
157 #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default"))) __attribute__((used))
158 #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default"))) __attribute__((used))
159 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
160 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
161 
162 #elif (defined(__GNUC__) || defined(__clang__)) && defined(_WIN32)
163 
164 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
165 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
166 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
167 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
168 
169 #elif defined(__GNUC__) || defined(__clang__)
170 
171 #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
172 #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
173 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
174 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
175 
176 #elif defined(_WIN32)
177 
178 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
179 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
180 #define LIBOPENMPT_API_HELPER_PUBLIC
181 #define LIBOPENMPT_API_HELPER_LOCAL
182 
183 #else
184 
185 #define LIBOPENMPT_API_HELPER_EXPORT
186 #define LIBOPENMPT_API_HELPER_IMPORT
187 #define LIBOPENMPT_API_HELPER_PUBLIC
188 #define LIBOPENMPT_API_HELPER_LOCAL
189 
190 #endif
191 
192 #if defined(LIBOPENMPT_BUILD_DLL)
193 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
194 #elif defined(LIBOPENMPT_USE_DLL)
195 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
196 #else
197 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
198 #endif
199 
200 #ifdef __cplusplus
201 
202 #define LIBOPENMPT_CXX_API LIBOPENMPT_API
203 
204 #if defined(LIBOPENMPT_USE_DLL)
205 #if defined(_MSC_VER) && !defined(_DLL)
206 #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."
207 #undef LIBOPENMPT_CXX_API
208 #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
209 #endif
210 #endif
211 
212 #if defined(__EMSCRIPTEN__)
213 
214 /* Only the C API is supported for emscripten. Disable the C++ API. */
215 #undef LIBOPENMPT_CXX_API
216 #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
217 #endif
218 
219 #endif
220 
226 /* C */
227 
228 #if !defined(LIBOPENMPT_NO_DEPRECATE)
229 #if defined(__clang__)
230 #define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
231 #elif defined(__GNUC__)
232 #define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
233 #elif defined(_MSC_VER)
234 #define LIBOPENMPT_DEPRECATED __declspec(deprecated)
235 #else
236 #define LIBOPENMPT_DEPRECATED
237 #endif
238 #else
239 #define LIBOPENMPT_DEPRECATED
240 #endif
241 
242 #ifndef __cplusplus
243 #if !defined(LIBOPENMPT_NO_DEPRECATE)
245 #define LIBOPENMPT_DEPRECATED_STRING( str ) ( LIBOPENMPT_DEPRECATED_STRING_CONSTANT ? ( str ) : ( str ) )
246 #else
247 #define LIBOPENMPT_DEPRECATED_STRING( str ) str
248 #endif
249 #else
250 #define LIBOPENMPT_DEPRECATED_STRING( str ) str
251 #endif
252 
253 #if defined(__STDC__) && (__STDC__ == 1)
254 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
255 #define LIBOPENMPT_C_INLINE inline
256 #else
257 #define LIBOPENMPT_C_INLINE
258 #endif
259 #else
260 #define LIBOPENMPT_C_INLINE
261 #endif
262 
263 
264 /* C++ */
265 
266 #ifdef __cplusplus
267 
268 #if defined(LIBOPENMPT_ASSUME_CPLUSPLUS)
269 #endif
270 
271 #if !defined(LIBOPENMPT_NO_DEPRECATE)
272 #define LIBOPENMPT_ATTR_DEPRECATED [[deprecated]]
273 #else
274 #define LIBOPENMPT_ATTR_DEPRECATED
275 #endif
276 
277 #endif
278 
279 
280 /* clang-format on */
281 
282 #include "libopenmpt_version.h"
283 
284 #endif /* LIBOPENMPT_CONFIG_H */
#define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:236
static const int LIBOPENMPT_DEPRECATED_STRING_CONSTANT
Definition: libopenmpt_config.h:244