OpenVDB  0.104.0
Platform.h
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2012 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 
39 #ifdef OPENVDB_DEPRECATED
40 #undef OPENVDB_DEPRECATED
41 #endif
42 #ifdef _MSC_VER
43  #define OPENVDB_DEPRECATED __declspec(deprecated)
44 #else
45  #define OPENVDB_DEPRECATED __attribute__ ((deprecated))
46 #endif
47 
49 #if defined(__GNUC__)
50  #define OPENVDB_CHECK_GCC(MAJOR, MINOR) \
51  (__GNUC__ > MAJOR || (__GNUC__ == MAJOR && __GNUC_MINOR__ >= MINOR))
52 #else
53  #define OPENVDB_CHECK_GCC(MAJOR, MINOR) 0
54 #endif
55 
59 #if defined(__GNUC__) && OPENVDB_CHECK_GCC(4, 4)
60  #define OPENVDB_STATIC_SPECIALIZATION
61 #else
62  #define OPENVDB_STATIC_SPECIALIZATION static
63 #endif
64 
68 #ifndef _USE_MATH_DEFINES
69  #define _USE_MATH_DEFINES
70 #endif
71 
73 #ifdef _MSC_VER
74  #include <boost/math/special_functions/round.hpp>
75  using boost::math::round;
76 #endif
77 
79 #ifdef _MSC_VER
80  #include <float.h>
81  static inline double copysign(double x, double y) { return _copysign(x, y); }
82 #endif
83 
86 #include <boost/cstdint.hpp>
87 using boost::int8_t;
88 using boost::int16_t;
89 using boost::int32_t;
90 using boost::int64_t;
91 using boost::uint8_t;
92 using boost::uint16_t;
93 using boost::uint32_t;
94 using boost::uint64_t;
95 
97 #ifdef OPENVDB_EXPORT
98 #undef OPENVDB_EXPORT
99 #endif
100 #ifdef OPENVDB_IMPORT
101 #undef OPENVDB_IMPORT
102 #endif
103 #ifdef __GNUC__
104  #define OPENVDB_EXPORT __attribute__((visibility("default")))
105  #define OPENVDB_IMPORT __attribute__((visibility("default")))
106 #endif
107 #ifdef _WIN32
108  #ifdef _DLL
109  #define OPENVDB_EXPORT __declspec(dllexport)
110  #define OPENVDB_IMPORT __declspec(dllimport)
111  #else
112  #define OPENVDB_EXPORT
113  #define OPENVDB_IMPORT
114  #endif
115 #endif
116 
120 #ifdef OPENVDB_API
121 #undef OPENVDB_API
122 #endif
123 #ifdef OPENVDB_PRIVATE
124  #define OPENVDB_API OPENVDB_EXPORT
125 #else
126  #define OPENVDB_API OPENVDB_IMPORT
127 #endif
128 #ifdef OPENVDB_HOUDINI_API
129 #undef OPENVDB_HOUDINI_API
130 #endif
131 #ifdef OPENVDB_HOUDINI_PRIVATE
132  #define OPENVDB_HOUDINI_API OPENVDB_EXPORT
133 #else
134  #define OPENVDB_HOUDINI_API OPENVDB_IMPORT
135 #endif
136 
137 // Windows build currently links to the shared Half.dll
138 #ifdef _WIN32
139  #define OPENEXR_DLL 1
140 #endif
141 
142 #endif // OPENVDB_PLATFORM_HAS_BEEN_INCLUDED
143 
144 // Copyright (c) 2012 DreamWorks Animation LLC
145 // All rights reserved. This software is distributed under the
146 // Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ )