libopenmpt  0.2.5787-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 
19 /* provoke warnings if already defined */
20 #define LIBOPENMPT_API
21 #undef LIBOPENMPT_API
22 #define LIBOPENMPT_CXX_API
23 #undef LIBOPENMPT_CXX_API
24 
25 #if defined(__DOXYGEN__)
26 
27 #define LIBOPENMPT_API_HELPER_EXPORT
28 #define LIBOPENMPT_API_HELPER_IMPORT
29 #define LIBOPENMPT_API_HELPER_PUBLIC
30 #define LIBOPENMPT_API_HELPER_LOCAL
31 
32 #elif defined(_MSC_VER)
33 
34 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
35 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
36 #define LIBOPENMPT_API_HELPER_PUBLIC
37 #define LIBOPENMPT_API_HELPER_LOCAL
38 
39 #elif defined(__GNUC__) || defined(__clang__)
40 
41 #if !defined(__EMSCRIPTEN__)
42 #if defined(_WIN32)
43 #define LIBOPENMPT_API_HELPER_EXPORT __declspec(dllexport)
44 #define LIBOPENMPT_API_HELPER_IMPORT __declspec(dllimport)
45 #else
46 #define LIBOPENMPT_API_HELPER_EXPORT __attribute__((visibility("default")))
47 #define LIBOPENMPT_API_HELPER_IMPORT __attribute__((visibility("default")))
48 #endif
49 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default")))
50 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
51 #else
52 #define LIBOPENMPT_API_HELPER_PUBLIC __attribute__((visibility("default"))) __attribute__((used))
53 #define LIBOPENMPT_API_HELPER_LOCAL __attribute__((visibility("hidden")))
54 #endif
55 
56 #else
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 #endif
64 
65 #if defined(LIBOPENMPT_BUILD_DLL)
66 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_EXPORT
67 #elif defined(LIBOPENMPT_USE_DLL)
68 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_IMPORT
69 #else
70 #define LIBOPENMPT_API LIBOPENMPT_API_HELPER_PUBLIC
71 #endif
72 
73 #ifdef __cplusplus
74 
75 #define LIBOPENMPT_CXX_API LIBOPENMPT_API
76 
77 #if defined(LIBOPENMPT_USE_DLL)
78 #if defined(_MSC_VER) && !defined(_DLL)
79 #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."
80 #undef LIBOPENMPT_CXX_API
81 #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
82 #endif
83 #endif
84 
85 #if defined(__EMSCRIPTEN__)
86 
87 /* Only the C API is supported for emscripten. Disable the C++ API. */
88 #undef LIBOPENMPT_CXX_API
89 #define LIBOPENMPT_CXX_API LIBOPENMPT_API_HELPER_LOCAL
90 #endif
91 
92 #endif
93 
98 #if defined(_MSC_VER)
99 #if (_MSC_VER >= 1500) && (_MSC_VER < 1600)
100 #ifndef LIBOPENMPT_ANCIENT_COMPILER
101 #define LIBOPENMPT_ANCIENT_COMPILER
102 #endif
103 #ifndef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR
104 #define LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR
105 #define LIBOPENMPT_SHARED_PTR std::tr1::shared_ptr
106 #endif
107 #ifndef LIBOPENMPT_ANCIENT_COMPILER_STDINT
108 #define LIBOPENMPT_ANCIENT_COMPILER_STDINT
109 #endif
110 #endif
111 #endif
112 
113 #if defined(__GNUC__) && !defined(__clang__)
114 #if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__*1 < 40300)
115 #ifndef LIBOPENMPT_ANCIENT_COMPILER
116 #define LIBOPENMPT_ANCIENT_COMPILER
117 #endif
118 #ifndef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR
119 #define LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR
120 #define LIBOPENMPT_SHARED_PTR std::tr1::shared_ptr
121 #endif
122 #ifndef LIBOPENMPT_ANCIENT_COMPILER_STDINT
123 #define LIBOPENMPT_ANCIENT_COMPILER_STDINT
124 #endif
125 #elif (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__*1 < 40400)
126 #ifndef LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR
127 #define LIBOPENMPT_ANCIENT_COMPILER_SHARED_PTR
128 #define LIBOPENMPT_SHARED_PTR std::shared_ptr
129 #endif
130 #endif
131 #endif
132 
133 #ifdef __cplusplus
134 #ifdef LIBOPENMPT_ANCIENT_COMPILER_STDINT
135 #include <stdint.h>
136 namespace std {
137 typedef int8_t int8_t;
138 typedef int16_t int16_t;
139 typedef int32_t int32_t;
140 typedef int64_t int64_t;
141 typedef uint8_t uint8_t;
142 typedef uint16_t uint16_t;
143 typedef uint32_t uint32_t;
144 typedef uint64_t uint64_t;
145 }
146 #endif
147 #endif
148 
149 #include "libopenmpt_version.h"
150 
151 #endif /* LIBOPENMPT_CONFIG_H */
STL namespace.