OpenVDB  1.1.0
Platform.h
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2012-2013 DreamWorks Animation LLC
4 //
5 // All rights reserved. This software is distributed under the
6 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )
7 //
8 // Redistributions of source code must retain the above copyright
9 // and license notice and the following restrictions and disclaimer.
10 //
11 // * Neither the name of DreamWorks Animation nor the names of
12 // its contributors may be used to endorse or promote products derived
13 // from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 // IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE
27 // LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00.
28 //
32 
33 #ifndef OPENVDB_PLATFORM_HAS_BEEN_INCLUDED
34 #define OPENVDB_PLATFORM_HAS_BEEN_INCLUDED
35 
36 #include "PlatformConfig.h"
37 
41 #ifdef OPENVDB_DEPRECATED
42 #undef OPENVDB_DEPRECATED
43 #endif
44 #ifdef _MSC_VER
45  #define OPENVDB_DEPRECATED __declspec(deprecated)
46 #else
47  #define OPENVDB_DEPRECATED __attribute__ ((deprecated))
48 #endif
49 
51 #if defined(__GNUC__)
52  #define OPENVDB_CHECK_GCC(MAJOR, MINOR) \
53  (__GNUC__ > MAJOR || (__GNUC__ == MAJOR && __GNUC_MINOR__ >= MINOR))
54 #else
55  #define OPENVDB_CHECK_GCC(MAJOR, MINOR) 0
56 #endif
57 
61 #if defined(__GNUC__) && OPENVDB_CHECK_GCC(4, 4)
62  #define OPENVDB_STATIC_SPECIALIZATION
63 #else
64  #define OPENVDB_STATIC_SPECIALIZATION static
65 #endif
66 
70 #ifndef _USE_MATH_DEFINES
71  #define _USE_MATH_DEFINES
72 #endif
73 
75 #ifdef _MSC_VER
76  #include <boost/math/special_functions/round.hpp>
77  using boost::math::round;
78 #endif
79 
81 #ifdef _MSC_VER
82  #include <float.h>
83  static inline double copysign(double x, double y) { return _copysign(x, y); }
84 #endif
85 
88 #include <boost/cstdint.hpp>
89 using boost::int8_t;
90 using boost::int16_t;
91 using boost::int32_t;
92 using boost::int64_t;
93 using boost::uint8_t;
94 using boost::uint16_t;
95 using boost::uint32_t;
96 using boost::uint64_t;
97 
99 #ifdef OPENVDB_EXPORT
100 #undef OPENVDB_EXPORT
101 #endif
102 #ifdef OPENVDB_IMPORT
103 #undef OPENVDB_IMPORT
104 #endif
105 #ifdef __GNUC__
106  #define OPENVDB_EXPORT __attribute__((visibility("default")))
107  #define OPENVDB_IMPORT __attribute__((visibility("default")))
108 #endif
109 #ifdef _WIN32
110  #ifdef OPENVDB_DLL
111  #define OPENVDB_EXPORT __declspec(dllexport)
112  #define OPENVDB_IMPORT __declspec(dllimport)
113  #else
114  #define OPENVDB_EXPORT
115  #define OPENVDB_IMPORT
116  #endif
117 #endif
118 
122 #ifdef OPENVDB_API
123 #undef OPENVDB_API
124 #endif
125 #ifdef OPENVDB_PRIVATE
126  #define OPENVDB_API OPENVDB_EXPORT
127 #else
128  #define OPENVDB_API OPENVDB_IMPORT
129 #endif
130 #ifdef OPENVDB_HOUDINI_API
131 #undef OPENVDB_HOUDINI_API
132 #endif
133 #ifdef OPENVDB_HOUDINI_PRIVATE
134  #define OPENVDB_HOUDINI_API OPENVDB_EXPORT
135 #else
136  #define OPENVDB_HOUDINI_API OPENVDB_IMPORT
137 #endif
138 
139 #endif // OPENVDB_PLATFORM_HAS_BEEN_INCLUDED
140 
141 // Copyright (c) 2012-2013 DreamWorks Animation LLC
142 // All rights reserved. This software is distributed under the
143 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )