1/*
2---------------------------------------------------------------------------
3Open Asset Import Library (assimp)
4---------------------------------------------------------------------------
5
6Copyright (c) 2006-2019, assimp team
7
8
9
10All rights reserved.
11
12Redistribution and use of this software in source and binary forms,
13with or without modification, are permitted provided that the following
14conditions are met:
15
16* Redistributions of source code must retain the above
17 copyright notice, this list of conditions and the
18 following disclaimer.
19
20* Redistributions in binary form must reproduce the above
21 copyright notice, this list of conditions and the
22 following disclaimer in the documentation and/or other
23 materials provided with the distribution.
24
25* Neither the name of the assimp team, nor the names of its
26 contributors may be used to endorse or promote products
27 derived from this software without specific prior
28 written permission of the assimp team.
29
30THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41---------------------------------------------------------------------------
42*/
43
44/** @file defs.h
45 * @brief Assimp build configuration setup. See the notes in the comment
46 * blocks to find out how to customize _your_ Assimp build.
47 */
48
49#pragma once
50#ifndef AI_DEFINES_H_INC
51#define AI_DEFINES_H_INC
52
53#include <assimp/config.h>
54
55//////////////////////////////////////////////////////////////////////////
56/* Define ASSIMP_BUILD_NO_XX_IMPORTER to disable a specific
57 * file format loader. The loader is be excluded from the
58 * build in this case. 'XX' stands for the most common file
59 * extension of the file format. E.g.:
60 * ASSIMP_BUILD_NO_X_IMPORTER disables the X loader.
61 *
62 * If you're unsure about that, take a look at the implementation of the
63 * import plugin you wish to disable. You'll find the right define in the
64 * first lines of the corresponding unit.
65 *
66 * Other (mixed) configuration switches are listed here:
67 * ASSIMP_BUILD_NO_COMPRESSED_X
68 * - Disable support for compressed X files (zip)
69 * ASSIMP_BUILD_NO_COMPRESSED_BLEND
70 * - Disable support for compressed Blender files (zip)
71 * ASSIMP_BUILD_NO_COMPRESSED_IFC
72 * - Disable support for IFCZIP files (unzip)
73 */
74//////////////////////////////////////////////////////////////////////////
75
76#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
77# define ASSIMP_BUILD_NEED_Z_INFLATE
78#endif
79
80#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
81# define ASSIMP_BUILD_NEED_Z_INFLATE
82#endif
83
84#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
85# define ASSIMP_BUILD_NEED_Z_INFLATE
86# define ASSIMP_BUILD_NEED_UNZIP
87#endif
88
89#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
90# define ASSIMP_BUILD_NEED_Z_INFLATE
91# define ASSIMP_BUILD_NEED_UNZIP
92#endif
93
94//////////////////////////////////////////////////////////////////////////
95/* Define ASSIMP_BUILD_NO_XX_PROCESS to disable a specific
96 * post processing step. This is the current list of process names ('XX'):
97 * CALCTANGENTS
98 * JOINVERTICES
99 * TRIANGULATE
100 * DROPFACENORMALS
101 * GENFACENORMALS
102 * GENVERTEXNORMALS
103 * REMOVEVC
104 * SPLITLARGEMESHES
105 * PRETRANSFORMVERTICES
106 * LIMITBONEWEIGHTS
107 * VALIDATEDS
108 * IMPROVECACHELOCALITY
109 * FIXINFACINGNORMALS
110 * REMOVE_REDUNDANTMATERIALS
111 * OPTIMIZEGRAPH
112 * SORTBYPTYPE
113 * FINDINVALIDDATA
114 * TRANSFORMTEXCOORDS
115 * GENUVCOORDS
116 * ENTITYMESHBUILDER
117 * EMBEDTEXTURES
118 * MAKELEFTHANDED
119 * FLIPUVS
120 * FLIPWINDINGORDER
121 * OPTIMIZEMESHES
122 * OPTIMIZEANIMS
123 * OPTIMIZEGRAPH
124 * GENENTITYMESHES
125 * FIXTEXTUREPATHS
126 * GENBOUNDINGBOXES */
127//////////////////////////////////////////////////////////////////////////
128
129#ifdef _MSC_VER
130# undef ASSIMP_API
131
132 //////////////////////////////////////////////////////////////////////////
133 /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
134 //////////////////////////////////////////////////////////////////////////
135# ifdef ASSIMP_BUILD_DLL_EXPORT
136# define ASSIMP_API __declspec(dllexport)
137# define ASSIMP_API_WINONLY __declspec(dllexport)
138# pragma warning (disable : 4251)
139
140 //////////////////////////////////////////////////////////////////////////
141 /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
142 * an external DLL under Windows. Default is static linkage. */
143 //////////////////////////////////////////////////////////////////////////
144# elif (defined ASSIMP_DLL)
145# define ASSIMP_API __declspec(dllimport)
146# define ASSIMP_API_WINONLY __declspec(dllimport)
147# else
148# define ASSIMP_API
149# define ASSIMP_API_WINONLY
150# endif
151
152 /* Force the compiler to inline a function, if possible
153 */
154# define AI_FORCE_INLINE __forceinline
155
156 /* Tells the compiler that a function never returns. Used in code analysis
157 * to skip dead paths (e.g. after an assertion evaluated to false). */
158# define AI_WONT_RETURN __declspec(noreturn)
159
160#elif defined(SWIG)
161
162 /* Do nothing, the relevant defines are all in AssimpSwigPort.i */
163
164#else
165
166# define AI_WONT_RETURN
167
168# define ASSIMP_API __attribute__ ((visibility("default")))
169# define ASSIMP_API_WINONLY
170# define AI_FORCE_INLINE inline
171#endif // (defined _MSC_VER)
172
173#ifdef __GNUC__
174# define AI_WONT_RETURN_SUFFIX __attribute__((noreturn))
175#else
176# define AI_WONT_RETURN_SUFFIX
177#endif // (defined __clang__)
178
179#ifdef __cplusplus
180 /* No explicit 'struct' and 'enum' tags for C++, this keeps showing up
181 * in doxydocs.
182 */
183# define C_STRUCT
184# define C_ENUM
185#else
186 //////////////////////////////////////////////////////////////////////////
187 /* To build the documentation, make sure ASSIMP_DOXYGEN_BUILD
188 * is defined by Doxygen's preprocessor. The corresponding
189 * entries in the DOXYFILE are: */
190 //////////////////////////////////////////////////////////////////////////
191#if 0
192 ENABLE_PREPROCESSING = YES
193 MACRO_EXPANSION = YES
194 EXPAND_ONLY_PREDEF = YES
195 SEARCH_INCLUDES = YES
196 INCLUDE_PATH =
197 INCLUDE_FILE_PATTERNS =
198 PREDEFINED = ASSIMP_DOXYGEN_BUILD=1
199 EXPAND_AS_DEFINED = C_STRUCT C_ENUM
200 SKIP_FUNCTION_MACROS = YES
201#endif
202 //////////////////////////////////////////////////////////////////////////
203 /* Doxygen gets confused if we use c-struct typedefs to avoid
204 * the explicit 'struct' notation. This trick here has the same
205 * effect as the TYPEDEF_HIDES_STRUCT option, but we don't need
206 * to typedef all structs/enums. */
207 //////////////////////////////////////////////////////////////////////////
208# if (defined ASSIMP_DOXYGEN_BUILD)
209# define C_STRUCT
210# define C_ENUM
211# else
212# define C_STRUCT struct
213# define C_ENUM enum
214# endif
215#endif
216
217#if (defined(__BORLANDC__) || defined (__BCPLUSPLUS__))
218# error Currently, Borland is unsupported. Feel free to port Assimp.
219#endif
220
221
222 //////////////////////////////////////////////////////////////////////////
223 /* Define ASSIMP_BUILD_SINGLETHREADED to compile assimp
224 * without threading support. The library doesn't utilize
225 * threads then and is itself not threadsafe. */
226 //////////////////////////////////////////////////////////////////////////
227#ifndef ASSIMP_BUILD_SINGLETHREADED
228# define ASSIMP_BUILD_SINGLETHREADED
229#endif
230
231#if defined(_DEBUG) || ! defined(NDEBUG)
232# define ASSIMP_BUILD_DEBUG
233#endif
234
235 //////////////////////////////////////////////////////////////////////////
236 /* Define ASSIMP_DOUBLE_PRECISION to compile assimp
237 * with double precision support (64-bit). */
238 //////////////////////////////////////////////////////////////////////////
239
240#ifdef ASSIMP_DOUBLE_PRECISION
241 typedef double ai_real;
242 typedef signed long long int ai_int;
243 typedef unsigned long long int ai_uint;
244#ifndef ASSIMP_AI_REAL_TEXT_PRECISION
245#define ASSIMP_AI_REAL_TEXT_PRECISION 16
246#endif // ASSIMP_AI_REAL_TEXT_PRECISION
247#else // ASSIMP_DOUBLE_PRECISION
248 typedef float ai_real;
249 typedef signed int ai_int;
250 typedef unsigned int ai_uint;
251#ifndef ASSIMP_AI_REAL_TEXT_PRECISION
252#define ASSIMP_AI_REAL_TEXT_PRECISION 8
253#endif // ASSIMP_AI_REAL_TEXT_PRECISION
254#endif // ASSIMP_DOUBLE_PRECISION
255
256 //////////////////////////////////////////////////////////////////////////
257 /* Useful constants */
258 //////////////////////////////////////////////////////////////////////////
259
260/* This is PI. Hi PI. */
261#define AI_MATH_PI (3.141592653589793238462643383279 )
262#define AI_MATH_TWO_PI (AI_MATH_PI * 2.0)
263#define AI_MATH_HALF_PI (AI_MATH_PI * 0.5)
264
265/* And this is to avoid endless casts to float */
266#define AI_MATH_PI_F (3.1415926538f)
267#define AI_MATH_TWO_PI_F (AI_MATH_PI_F * 2.0f)
268#define AI_MATH_HALF_PI_F (AI_MATH_PI_F * 0.5f)
269
270/* Tiny macro to convert from radians to degrees and back */
271#define AI_DEG_TO_RAD(x) ((x)*(ai_real)0.0174532925)
272#define AI_RAD_TO_DEG(x) ((x)*(ai_real)57.2957795)
273
274/* Numerical limits */
275static const ai_real ai_epsilon = (ai_real) 0.00001;
276
277/* Support for big-endian builds */
278#if defined(__BYTE_ORDER__)
279# if (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
280# if !defined(__BIG_ENDIAN__)
281# define __BIG_ENDIAN__
282# endif
283# else /* little endian */
284# if defined (__BIG_ENDIAN__)
285# undef __BIG_ENDIAN__
286# endif
287# endif
288#endif
289#if defined(__BIG_ENDIAN__)
290# define AI_BUILD_BIG_ENDIAN
291#endif
292
293
294/* To avoid running out of memory
295 * This can be adjusted for specific use cases
296 * It's NOT a total limit, just a limit for individual allocations
297 */
298#define AI_MAX_ALLOC(type) ((256U * 1024 * 1024) / sizeof(type))
299
300#ifndef _MSC_VER
301# define AI_NO_EXCEPT noexcept
302#else
303# if (_MSC_VER >= 1915 )
304# define AI_NO_EXCEPT noexcept
305# else
306# define AI_NO_EXCEPT
307# endif
308#endif // _MSC_VER
309
310#endif // !! AI_DEFINES_H_INC
311

source code of qt3d/src/3rdparty/assimp/src/include/assimp/defs.h