libopenmpt 0.6.0-pre.14+r15706M
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
28#define LIBOPENMPT_STREAM_CALLBACKS_BUFFER
29
41#define LIBOPENMPT_STREAM_CALLBACKS_FD
42
54#define LIBOPENMPT_STREAM_CALLBACKS_FILE
55
56#if defined(__DOXYGEN__)
57
58#define LIBOPENMPT_API_HELPER_EXPORT
59#define LIBOPENMPT_API_HELPER_IMPORT
60#define LIBOPENMPT_API_HELPER_PUBLIC
61#define LIBOPENMPT_API_HELPER_LOCAL
62
63#elif defined(_MSC_VER)
64
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
70#elif defined(__EMSCRIPTEN__)
71
72#define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default"))) __attribute__((used))
73#define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default"))) __attribute__((used))
74#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
75#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
76
77#elif (defined(__GNUC__) || defined(__clang__)) && defined(_WIN32)
78
79#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
80#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
81#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
82#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
83
84#elif defined(__GNUC__) || defined(__clang__)
85
86#define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
87#define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
88#define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
89#define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
90
91#elif defined(_WIN32)
92
93#define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
94#define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
95#define LIBOPENMPT_API_HELPER_PUBLIC
96#define LIBOPENMPT_API_HELPER_LOCAL
97
98#else
99
100#define LIBOPENMPT_API_HELPER_EXPORT
101#define LIBOPENMPT_API_HELPER_IMPORT
102#define LIBOPENMPT_API_HELPER_PUBLIC
103#define LIBOPENMPT_API_HELPER_LOCAL
104
105#endif
106
107#if defined(LIBOPENMPT_BUILD_DLL)
108#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
109#elif defined(LIBOPENMPT_USE_DLL)
110#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
111#else
112#define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
113#endif
114
115#ifdef __cplusplus
116
117#define LIBOPENMPT_CXX_API LIBOPENMPT_API
118
119#if defined(LIBOPENMPT_USE_DLL)
120#if defined(_MSC_VER) && !defined(_DLL)
121#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."
122#undef LIBOPENMPT_CXX_API
123#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
124#endif
125#endif
126
127#if defined(__EMSCRIPTEN__)
128
129/* Only the C API is supported for emscripten. Disable the C++ API. */
130#undef LIBOPENMPT_CXX_API
131#define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
132#endif
133
134#endif
135
141/* C */
142
143#if !defined(LIBOPENMPT_NO_DEPRECATE)
144#if defined(__clang__)
145#define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
146#elif defined(__GNUC__)
147#define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
148#elif defined(_MSC_VER)
149#define LIBOPENMPT_DEPRECATED __declspec(deprecated)
150#else
151#define LIBOPENMPT_DEPRECATED
152#endif
153#else
154#define LIBOPENMPT_DEPRECATED
155#endif
156
157#ifndef __cplusplus
158#if !defined(LIBOPENMPT_NO_DEPRECATE)
160#define LIBOPENMPT_DEPRECATED_STRING( str ) ( LIBOPENMPT_DEPRECATED_STRING_CONSTANT ? ( str ) : ( str ) )
161#else
162#define LIBOPENMPT_DEPRECATED_STRING( str ) str
163#endif
164#endif
165
166
167/* C++ */
168
169#ifdef __cplusplus
170
171#if defined(LIBOPENMPT_ASSUME_CPLUSPLUS)
172#endif
173
174#if !defined(LIBOPENMPT_NO_DEPRECATE)
175#define LIBOPENMPT_ATTR_DEPRECATED [[deprecated]]
176#else
177#define LIBOPENMPT_ATTR_DEPRECATED
178#endif
179
180#endif
181
182
183/* clang-format on */
184
185#include "libopenmpt_version.h"
186
187#endif /* LIBOPENMPT_CONFIG_H */
#define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:151
static const int LIBOPENMPT_DEPRECATED_STRING_CONSTANT
Definition: libopenmpt_config.h:159