libopenmpt  0.7.0-pre.2+r16646
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 
37 #define LIBOPENMPT_STREAM_CALLBACKS_BUFFER
38 
50 #define LIBOPENMPT_STREAM_CALLBACKS_FD
51 
63 #define LIBOPENMPT_STREAM_CALLBACKS_FILE
64 
78 #define LIBOPENMPT_STREAM_CALLBACKS_FILE_MINGW
79 
93 #define LIBOPENMPT_STREAM_CALLBACKS_FILE_MSVCRT
94 
108 #define LIBOPENMPT_STREAM_CALLBACKS_FILE_POSIX
109 
123 #define LIBOPENMPT_STREAM_CALLBACKS_FILE_POSIX_LFS64
124 
125 #if defined(__DOXYGEN__)
126 
127 #define LIBOPENMPT_API_HELPER_EXPORT
128 #define LIBOPENMPT_API_HELPER_IMPORT
129 #define LIBOPENMPT_API_HELPER_PUBLIC
130 #define LIBOPENMPT_API_HELPER_LOCAL
131 
132 #elif defined(_MSC_VER)
133 
134 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
135 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
136 #define LIBOPENMPT_API_HELPER_PUBLIC
137 #define LIBOPENMPT_API_HELPER_LOCAL
138 
139 #elif defined(__EMSCRIPTEN__)
140 
141 #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default"))) __attribute__((used))
142 #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default"))) __attribute__((used))
143 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
144 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
145 
146 #elif (defined(__GNUC__) || defined(__clang__)) && defined(_WIN32)
147 
148 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
149 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
150 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
151 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
152 
153 #elif defined(__GNUC__) || defined(__clang__)
154 
155 #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
156 #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
157 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
158 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
159 
160 #elif defined(_WIN32)
161 
162 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
163 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
164 #define LIBOPENMPT_API_HELPER_PUBLIC
165 #define LIBOPENMPT_API_HELPER_LOCAL
166 
167 #else
168 
169 #define LIBOPENMPT_API_HELPER_EXPORT
170 #define LIBOPENMPT_API_HELPER_IMPORT
171 #define LIBOPENMPT_API_HELPER_PUBLIC
172 #define LIBOPENMPT_API_HELPER_LOCAL
173 
174 #endif
175 
176 #if defined(LIBOPENMPT_BUILD_DLL)
177 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
178 #elif defined(LIBOPENMPT_USE_DLL)
179 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
180 #else
181 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
182 #endif
183 
184 #ifdef __cplusplus
185 
186 #define LIBOPENMPT_CXX_API LIBOPENMPT_API
187 
188 #if defined(LIBOPENMPT_USE_DLL)
189 #if defined(_MSC_VER) && !defined(_DLL)
190 #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."
191 #undef LIBOPENMPT_CXX_API
192 #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
193 #endif
194 #endif
195 
196 #if defined(__EMSCRIPTEN__)
197 
198 /* Only the C API is supported for emscripten. Disable the C++ API. */
199 #undef LIBOPENMPT_CXX_API
200 #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
201 #endif
202 
203 #endif
204 
210 /* C */
211 
212 #if !defined(LIBOPENMPT_NO_DEPRECATE)
213 #if defined(__clang__)
214 #define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
215 #elif defined(__GNUC__)
216 #define LIBOPENMPT_DEPRECATED __attribute__((deprecated))
217 #elif defined(_MSC_VER)
218 #define LIBOPENMPT_DEPRECATED __declspec(deprecated)
219 #else
220 #define LIBOPENMPT_DEPRECATED
221 #endif
222 #else
223 #define LIBOPENMPT_DEPRECATED
224 #endif
225 
226 #ifndef __cplusplus
227 #if !defined(LIBOPENMPT_NO_DEPRECATE)
229 #define LIBOPENMPT_DEPRECATED_STRING( str ) ( LIBOPENMPT_DEPRECATED_STRING_CONSTANT ? ( str ) : ( str ) )
230 #else
231 #define LIBOPENMPT_DEPRECATED_STRING( str ) str
232 #endif
233 #else
234 #define LIBOPENMPT_DEPRECATED_STRING( str ) str
235 #endif
236 
237 #if defined(__STDC__) && (__STDC__ == 1)
238 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
239 #define LIBOPENMPT_C_INLINE inline
240 #else
241 #define LIBOPENMPT_C_INLINE
242 #endif
243 #else
244 #define LIBOPENMPT_C_INLINE
245 #endif
246 
247 
248 /* C++ */
249 
250 #ifdef __cplusplus
251 
252 #if defined(LIBOPENMPT_ASSUME_CPLUSPLUS)
253 #endif
254 
255 #if !defined(LIBOPENMPT_NO_DEPRECATE)
256 #define LIBOPENMPT_ATTR_DEPRECATED [[deprecated]]
257 #else
258 #define LIBOPENMPT_ATTR_DEPRECATED
259 #endif
260 
261 #endif
262 
263 
264 /* clang-format on */
265 
266 #include "libopenmpt_version.h"
267 
268 #endif /* LIBOPENMPT_CONFIG_H */
#define LIBOPENMPT_DEPRECATED
Definition: libopenmpt_config.h:220
static const int LIBOPENMPT_DEPRECATED_STRING_CONSTANT
Definition: libopenmpt_config.h:228