libopenmpt 0.7.12+release
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#ifdef __cplusplus
156#define LIBOPENMPT_API_HELPER_EXPORT_CLASS __declspec(dllexport)
157#define LIBOPENMPT_API_HELPER_IMPORT_CLASS __declspec(dllimport)
158#define LIBOPENMPT_API_HELPER_PUBLIC_CLASS
159#define LIBOPENMPT_API_HELPER_LOCAL_CLASS
160#endif
161
162#elif defined(__EMSCRIPTEN__)
163
164#define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default"))) __attribute__((used))
165#define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default"))) __attribute__((used))
166#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
167#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
168
169#ifdef __cplusplus
170#define LIBOPENMPT_API_HELPER_EXPORT_CLASS __attribute__((visibility("default")))
171#define LIBOPENMPT_API_HELPER_IMPORT_CLASS __attribute__((visibility("default")))
172#define LIBOPENMPT_API_HELPER_PUBLIC_CLASS __attribute__((visibility("default")))
173#define LIBOPENMPT_API_HELPER_LOCAL_CLASS __attribute__((visibility("hidden")))
174#define LIBOPENMPT_API_HELPER_EXPORT_MEMBER __attribute__((visibility("default"))) __attribute__((used))
175#define LIBOPENMPT_API_HELPER_IMPORT_MEMBER __attribute__((visibility("default"))) __attribute__((used))
176#define LIBOPENMPT_API_HELPER_PUBLIC_MEMBER __attribute__((visibility("default"))) __attribute__((used))
177#define LIBOPENMPT_API_HELPER_LOCAL_MEMBER __attribute__((visibility("hidden")))
178#endif
179
180#elif (defined(__GNUC__) || defined(__clang__)) && defined(_WIN32)
181
182#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
183#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
184#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
185#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
186
187#ifdef __cplusplus
188#define LIBOPENMPT_API_HELPER_EXPORT_CLASS __declspec(dllexport)
189#define LIBOPENMPT_API_HELPER_IMPORT_CLASS __declspec(dllimport)
190#define LIBOPENMPT_API_HELPER_PUBLIC_CLASS __attribute__((visibility("default")))
191#define LIBOPENMPT_API_HELPER_LOCAL_CLASS __attribute__((visibility("hidden")))
192#endif
193
194#elif defined(__GNUC__) || defined(__clang__)
195
196#define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
197#define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
198#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
199#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
200
201#ifdef __cplusplus
202#define LIBOPENMPT_API_HELPER_EXPORT_CLASS __attribute__((visibility("default")))
203#define LIBOPENMPT_API_HELPER_IMPORT_CLASS __attribute__((visibility("default")))
204#define LIBOPENMPT_API_HELPER_PUBLIC_CLASS __attribute__((visibility("default")))
205#define LIBOPENMPT_API_HELPER_LOCAL_CLASS __attribute__((visibility("hidden")))
206#endif
207
208#elif defined(_WIN32)
209
210#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
211#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
212#define LIBOPENMPT_API_HELPER_PUBLIC
213#define LIBOPENMPT_API_HELPER_LOCAL
214
215#ifdef __cplusplus
216
217#define LIBOPENMPT_API_HELPER_EXPORT_CLASS __declspec(dllexport)
218#define LIBOPENMPT_API_HELPER_IMPORT_CLASS __declspec(dllimport)
219#define LIBOPENMPT_API_HELPER_PUBLIC_CLASS
220#define LIBOPENMPT_API_HELPER_LOCAL_CLASS
221
222#endif
223
224#else
225
226#define LIBOPENMPT_API_HELPER_EXPORT
227#define LIBOPENMPT_API_HELPER_IMPORT
228#define LIBOPENMPT_API_HELPER_PUBLIC
229#define LIBOPENMPT_API_HELPER_LOCAL
230
231#endif
232
233#ifdef __cplusplus
234
235#ifndef LIBOPENMPT_API_HELPER_EXPORT_CLASS
236#define LIBOPENMPT_API_HELPER_EXPORT_CLASS
237#endif
238#ifndef LIBOPENMPT_API_HELPER_EXPORT_MEMBER
239#define LIBOPENMPT_API_HELPER_EXPORT_MEMBER
240#endif
241#ifndef LIBOPENMPT_API_HELPER_IMPORT_CLASS
242#define LIBOPENMPT_API_HELPER_IMPORT_CLASS
243#endif
244#ifndef LIBOPENMPT_API_HELPER_IMPORT_MEMBER
245#define LIBOPENMPT_API_HELPER_IMPORT_MEMBER
246#endif
247#ifndef LIBOPENMPT_API_HELPER_PUBLIC_CLASS
248#define LIBOPENMPT_API_HELPER_PUBLIC_CLASS
249#endif
250#ifndef LIBOPENMPT_API_HELPER_PUBLIC_MEMBER
251#define LIBOPENMPT_API_HELPER_PUBLIC_MEMBER
252#endif
253#ifndef LIBOPENMPT_API_HELPER_LOCAL_CLASS
254#define LIBOPENMPT_API_HELPER_LOCAL_CLASS
255#endif
256#ifndef LIBOPENMPT_API_HELPER_LOCAL_MEMBER
257#define LIBOPENMPT_API_HELPER_LOCAL_MEMBER
258#endif
259
260#endif
261
262#if defined(LIBOPENMPT_BUILD_DLL)
263#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
264#elif defined(LIBOPENMPT_USE_DLL)
265#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
266#else
267#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
268#endif
269
270#ifdef __cplusplus
271
272#if defined(LIBOPENMPT_BUILD_DLL)
273#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_EXPORT
274#define LIBOPENMPT_CXX_API_CLASS LIBOPENMPT_API_HELPER_EXPORT_CLASS
275#define LIBOPENMPT_CXX_API_MEMBER LIBOPENMPT_API_HELPER_EXPORT_MEMBER
276#elif defined(LIBOPENMPT_USE_DLL)
277#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_IMPORT
278#define LIBOPENMPT_CXX_API_CLASS LIBOPENMPT_API_HELPER_IMPORT_CLASS
279#define LIBOPENMPT_CXX_API_MEMBER LIBOPENMPT_API_HELPER_IMPORT_MEMBER
280#else
281#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_PUBLIC
282#define LIBOPENMPT_CXX_API_CLASS LIBOPENMPT_API_HELPER_PUBLIC_CLASS
283#define LIBOPENMPT_CXX_API_MEMBER LIBOPENMPT_API_HELPER_PUBLIC_MEMBER
284#endif
285
286#if defined(LIBOPENMPT_USE_DLL)
287#if defined(_MSC_VER) && !defined(_DLL)
288#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."
289#undef LIBOPENMPT_CXX_API
290#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
291#undef LIBOPENMPT_CXX_API_CLASS
292#define LIBOPENMPT_CXX_API_CLASS LIBOPENMPT_API_HELPER_LOCAL_CLASS
293#undef LIBOPENMPT_CXX_API_MEMBER
294#define LIBOPENMPT_CXX_API_MEMBER LIBOPENMPT_API_HELPER_LOCAL_MEMBER
295#endif
296#endif
297
298#endif
299
305/* C */
306
307#if !defined(LIBOPENMPT_NO_DEPRECATE)
308#if defined(__clang__)
309#define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
310#elif defined(__GNUC__)
311#define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
312#elif defined(_MSC_VER)
313#define LIBOPENMPT_DEPRECATED __declspec(deprecated)
314#else
315#define LIBOPENMPT_DEPRECATED
316#endif
317#else
318#define LIBOPENMPT_DEPRECATED
319#endif
320
321#ifndef __cplusplus
322#if !defined(LIBOPENMPT_NO_DEPRECATE)
324#define LIBOPENMPT_DEPRECATED_STRING( str ) ( LIBOPENMPT_DEPRECATED_STRING_CONSTANT ? ( str ) : ( str ) )
325#else
326#define LIBOPENMPT_DEPRECATED_STRING( str ) str
327#endif
328#else
329#define LIBOPENMPT_DEPRECATED_STRING( str ) str
330#endif
331
332#if defined(__STDC__) && (__STDC__ == 1)
333#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
334#define LIBOPENMPT_C_INLINE inline
335#else
336#define LIBOPENMPT_C_INLINE
337#endif
338#else
339#define LIBOPENMPT_C_INLINE
340#endif
341
342
343/* C++ */
344
345#ifdef __cplusplus
346
347#if defined(LIBOPENMPT_ASSUME_CPLUSPLUS)
348#endif
349
350#if !defined(LIBOPENMPT_NO_DEPRECATE)
351#define LIBOPENMPT_ATTR_DEPRECATED [[deprecated]]
352#else
353#define LIBOPENMPT_ATTR_DEPRECATED
354#endif
355
356#endif
357
358
359/* clang-format on */
360
361#include "libopenmpt_version.h"
362
363#endif /* LIBOPENMPT_CONFIG_H */
#define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:315
static const int LIBOPENMPT_DEPRECATED_STRING_CONSTANT
Definition: libopenmpt_config.h:323