Essentia  2.1-beta5-dev
config.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Essentia
5  *
6  * Essentia is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License as published by the Free
8  * Software Foundation (FSF), either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the Affero GNU General Public License
17  * version 3 along with this program. If not, see http://www.gnu.org/licenses/
18  */
19 
20 #ifndef ESSENTIA_CONFIG_H
21 #define ESSENTIA_CONFIG_H
22 
23 #include "version.h"
24 
28 #ifndef ESSENTIA_VERSION
29 #define ESSENTIA_VERSION "Undefined"
30 #endif
31 
32 
37 #ifndef ESSENTIA_GIT_SHA
38 #define ESSENTIA_GIT_SHA "Undefined"
39 #endif
40 
41 
49 #ifndef DEBUGGING_ENABLED
50 #define DEBUGGING_ENABLED 1
51 #endif
52 
53 
59 #ifndef ESSENTIA_EXPORTS
60 #define ESSENTIA_EXPORTS 1
61 #endif
62 
63 
68 #ifndef STRIP_DOCUMENTATION
69 #define STRIP_DOCUMENTATION 0
70 #endif
71 
72 
77 #ifndef CASE_SENSITIVE
78 #define CASE_SENSITIVE 1
79 #endif
80 
81 
88 #ifndef SAFE_TYPE_COMPARISONS
89 #define SAFE_TYPE_COMPARISONS 0
90 #endif
91 
92 
100 #ifndef ALLOW_DEFAULT_PARAMETERS
101 #define ALLOW_DEFAULT_PARAMETERS 1
102 #endif
103 
107 #if __cplusplus >= 201103L
108 # define CPP_11
109 #endif
110 
114 #if defined(_MSC_VER) || defined(_WIN32)
115 # define OS_WIN32
116 #else
117 # if defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
118 # define OS_MAC
119 # elif defined(__FreeBSD__)
120 # define OS_FREEBSD
121 # else
122 # define OS_LINUX
123 # endif
124 #endif
125 
126 
127 #ifndef DOXYGEN_SHOULD_SKIP_THIS
128 
129 // some Windows peculiarities that need to be fixed
130 #ifdef OS_WIN32
131 
132  #pragma warning (disable : 4251 4275) // disable the DLL warnings...
133  #pragma warning (disable : 4244 4305 4267) // disable float<=>double conversion warnings
134  #pragma warning (disable : 4996) // XYZ was declared deprecated
135  #pragma warning (disable : 4146) // MersenneTwister.h:273 unary minus operator applied to unsigned type, result still unsigned
136  #pragma warning (disable : 4355) // this used in class initialization, but we do it in a safe way
137 
138  // tell microsoft we would like to use std::min and std::max
139  #define NOMINMAX
140 
141  typedef unsigned int uint;
142 
143  #define strcasecmp _stricmp
144 
145  #include <float.h>
146 
147  // don't need this for MINGW // TODO test
148  /*
149  namespace std {
150  template <typename T>
151  inline bool isnan(T x) {
152  return _isnan(x) != 0;
153  }
154  template <typename T>
155  inline bool isinf(T x) {
156  return _finite(x) == 0;
157  }
158  } */
159 #endif // OS_WIN32
160 
161 
162 #ifdef OS_MAC
163 typedef unsigned int uint;
164 #endif // OS_MAC
165 
166 
167 // returns GCC version as a single constant, valid for both linux & mac
168 #ifndef OS_WIN32
169 # define GCC_VERSION (__GNUC__ * 10000 \
170  + __GNUC_MINOR__ * 100 \
171  + __GNUC_PATCHLEVEL__)
172 #endif // OS_WIN32
173 
174 
175 // Visibility options.
176 // Functions will not appear as part of a DSO exported objects by default
177 // unless they have been marked with an ESSENTIA_API qualifier.
178 // See http://gcc.gnu.org/wiki/Visibility for more information on the subject.
179 #ifdef OS_WIN32
180 # define ESSENTIA_DLLEXPORT __declspec(dllexport)
181 # define ESSENTIA_DLLIMPORT __declspec(dllimport)
182 #else
183 # if (GCC_VERSION >= 40000)
184 # define ESSENTIA_DLLEXPORT __attribute__ ((visibility("default")))
185 # define ESSENTIA_DLLIMPORT __attribute__ ((visibility("default")))
186 # else
187 # define ESSENTIA_DLLEXPORT
188 # define ESSENTIA_DLLIMPORT
189 # endif
190 #endif
191 
192 
193 // define ESSENTIA_EXPORTS when building the DLL, don't when importing it
194 // into your application.
195 #if ESSENTIA_EXPORTS
196 # define ESSENTIA_API ESSENTIA_DLLEXPORT
197 #else
198 # define ESSENTIA_API ESSENTIA_DLLIMPORT
199 #endif
200 
201 
202 // do we strip algorithm documentation from the resulting binary or not?
203 #if STRIP_DOCUMENTATION
204 # define DOC(x) "Unavailable"
205 #else
206 # define DOC(x) x
207 #endif
208 
209 
210 // case-insensitive or not?
211 #if CASE_SENSITIVE
212 # define string_cmp std::less<std::string>
213 # define charptr_cmp strcmp
214 #else
215 # define string_cmp case_insensitive_str_cmp
216 # define charptr_cmp strcasecmp
217 #endif
218 
219 
220 #endif // DOXYGEN_SHOULD_SKIP_THIS
221 
222 
223 #endif // ESSENTIA_CONFIG_H
unsigned int uint
Definition: types.h:48