OpenVDB: version.h Source File

OpenVDB 8.0.0

version.h
Go to the documentation of this file.
1 // Copyright Contributors to the OpenVDB Project
2 // SPDX-License-Identifier: MPL-2.0
3
41
42 #ifndef OPENVDB_VERSION_HAS_BEEN_INCLUDED
43 #define OPENVDB_VERSION_HAS_BEEN_INCLUDED
44
45 #include "Platform.h"
46 #include <cstddef> // size_t
47 #include <cstdint> // uint32_t
48
49
50 // Library major, minor and patch version numbers
51 #define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER 8
52 #define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER 0
53 #define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER 0
54
55 // If OPENVDB_ABI_VERSION_NUMBER is already defined (e.g., via -DOPENVDB_ABI_VERSION_NUMBER=N)
56 // use that ABI version. Otherwise, use this library version's default ABI.
57 #ifdef OPENVDB_ABI_VERSION_NUMBER
58 #if OPENVDB_ABI_VERSION_NUMBER > OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
59 #error expected OPENVDB_ABI_VERSION_NUMBER <= OPENVDB_LIBRARY_MAJOR VERSION_NUMBER
60 #endif
61 #else
62 #define OPENVDB_ABI_VERSION_NUMBER OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
63 #endif
64
65 // If using an OPENVDB_ABI_VERSION_NUMBER that has been deprecated, issue a message
66 // directive. Note that an error is also set in openvdb.cc which enforces stricter
67 // behavior during compilation of the library. Both can be optionally suppressed
68 // by defining OPENVDB_USE_DEPRECATED_ABI_<VERSION>.
69 #ifndef OPENVDB_USE_DEPRECATED_ABI_5
70 #if OPENVDB_ABI_VERSION_NUMBER == 5
71 PRAGMA(message("NOTE: ABI = 5 is deprecated, CMake option OPENVDB_USE_DEPRECATED_ABI_5 "
72 "suppresses this message"))
73 #endif
74 #endif
75 #ifndef OPENVDB_USE_DEPRECATED_ABI_6
76 #if OPENVDB_ABI_VERSION_NUMBER == 6
77 PRAGMA(message("NOTE: ABI = 6 is deprecated, CMake option OPENVDB_USE_DEPRECATED_ABI_6 "
78 "suppresses this message"))
79 #endif
80 #endif
81
82 #if OPENVDB_ABI_VERSION_NUMBER == OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
83 #define OPENVDB_VERSION_NAME \
102 OPENVDB_PREPROC_CONCAT(v, \
103 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER, \
104 OPENVDB_PREPROC_CONCAT(_, OPENVDB_LIBRARY_MINOR_VERSION_NUMBER)))
105 #else
106 // This duplication of code is necessary to avoid issues with recursive macro expansion.
107 #define OPENVDB_VERSION_NAME \
108 OPENVDB_PREPROC_CONCAT(v, \
109 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER, \
110 OPENVDB_PREPROC_CONCAT(_, \
111 OPENVDB_PREPROC_CONCAT(OPENVDB_LIBRARY_MINOR_VERSION_NUMBER, \
112 OPENVDB_PREPROC_CONCAT(abi, OPENVDB_ABI_VERSION_NUMBER)))))
113 #endif
114
120 #define OPENVDB_LIBRARY_VERSION_STRING \
121 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER) "." \
122 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_MINOR_VERSION_NUMBER) "." \
123 OPENVDB_PREPROC_STRINGIFY(OPENVDB_LIBRARY_PATCH_VERSION_NUMBER)
124
130 #define OPENVDB_LIBRARY_ABI_VERSION_STRING \
131 OPENVDB_LIBRARY_VERSION_STRING "abi" OPENVDB_PREPROC_STRINGIFY(OPENVDB_ABI_VERSION_NUMBER)
132
134 #define OPENVDB_LIBRARY_VERSION_NUMBER \
135 ((OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER << 24) | \
136 ((OPENVDB_LIBRARY_MINOR_VERSION_NUMBER & 0xFF) << 16) | \
137 (OPENVDB_LIBRARY_PATCH_VERSION_NUMBER & 0xFFFF))
138
139
148 #ifdef OPENVDB_REQUIRE_VERSION_NAME
149 #define OPENVDB_USE_VERSION_NAMESPACE
150 #else
151 // The empty namespace clause below ensures that OPENVDB_VERSION_NAME
152 // is recognized as a namespace name.
153 #define OPENVDB_USE_VERSION_NAMESPACE \
154 namespace OPENVDB_VERSION_NAME {} \
155 using namespace OPENVDB_VERSION_NAME;
156 #endif
157
158
159 namespace openvdb {
160 OPENVDB_USE_VERSION_NAMESPACE
161 namespace OPENVDB_VERSION_NAME {
162
165 const int32_t OPENVDB_MAGIC = 0x56444220;
166
167 // Library major, minor and patch version numbers
168 const uint32_t
169 OPENVDB_LIBRARY_MAJOR_VERSION = OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER,
170 OPENVDB_LIBRARY_MINOR_VERSION = OPENVDB_LIBRARY_MINOR_VERSION_NUMBER,
171 OPENVDB_LIBRARY_PATCH_VERSION = OPENVDB_LIBRARY_PATCH_VERSION_NUMBER;
173 const uint32_t OPENVDB_LIBRARY_VERSION = OPENVDB_LIBRARY_VERSION_NUMBER;
174 // ABI version number
175 const uint32_t OPENVDB_ABI_VERSION = OPENVDB_ABI_VERSION_NUMBER;
176
180 const uint32_t OPENVDB_FILE_VERSION = 224;
181
183 enum {
184 OPENVDB_FILE_VERSION_ROOTNODE_MAP = 213,
185 OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION = 214,
186 OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME = 215,
187 OPENVDB_FILE_VERSION_GRID_INSTANCING = 216,
188 OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION = 217,
189 OPENVDB_FILE_VERSION_BOOST_UUID = 218,
190 OPENVDB_FILE_VERSION_NO_GRIDMAP = 219,
191 OPENVDB_FILE_VERSION_NEW_TRANSFORM = 219,
192 OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION = 220,
193 OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX = 221,
194 OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION = 222,
195 OPENVDB_FILE_VERSION_BLOSC_COMPRESSION = 223,
196 OPENVDB_FILE_VERSION_POINT_INDEX_GRID = 223,
197 OPENVDB_FILE_VERSION_MULTIPASS_IO = 224
198 };
199
200
202 inline constexpr const char* getLibraryVersionString() { return OPENVDB_LIBRARY_VERSION_STRING; }
204 inline constexpr const char* getLibraryAbiVersionString() {
205 return OPENVDB_LIBRARY_ABI_VERSION_STRING;
206 }
207
208
209 struct VersionId {
210 uint32_t first, second;
211 VersionId(): first(0), second(0) {}
212 VersionId(uint32_t major, uint32_t minor): first(major), second(minor) {}
213 };
214
215 } // namespace OPENVDB_VERSION_NAME
216 } // namespace openvdb
217
218 #endif // OPENVDB_VERSION_HAS_BEEN_INCLUDED
openvdb::v8_2::getLibraryAbiVersionString
constexpr const char * getLibraryAbiVersionString()
Return a library version number string of the form "<major>.<minor>.<patch>abi<abi>".
Definition: version.h:204
openvdb::v8_2::OPENVDB_FILE_VERSION_ROOTNODE_MAP
@ OPENVDB_FILE_VERSION_ROOTNODE_MAP
Definition: version.h:184
PRAGMA
#define PRAGMA(x)
Definition: Platform.h:11
OPENVDB_LIBRARY_VERSION_STRING
#define OPENVDB_LIBRARY_VERSION_STRING
Library version number string of the form "<major>.<minor>.<patch>".
Definition: version.h:120
openvdb::v8_2::OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME
@ OPENVDB_FILE_VERSION_SIMPLIFIED_GRID_TYPENAME
Definition: version.h:186
OPENVDB_LIBRARY_PATCH_VERSION_NUMBER
#define OPENVDB_LIBRARY_PATCH_VERSION_NUMBER
Definition: version.h:53
openvdb::v8_2::OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION
@ OPENVDB_FILE_VERSION_BOOL_LEAF_OPTIMIZATION
Definition: version.h:188
openvdb::v8_2::OPENVDB_ABI_VERSION
const uint32_t OPENVDB_ABI_VERSION
Definition: version.h:175
openvdb::v8_2::OPENVDB_FILE_VERSION_POINT_INDEX_GRID
@ OPENVDB_FILE_VERSION_POINT_INDEX_GRID
Definition: version.h:196
OPENVDB_LIBRARY_ABI_VERSION_STRING
#define OPENVDB_LIBRARY_ABI_VERSION_STRING
Library version number string of the form "<major>.<minor>.<patch>abi<abi>".
Definition: version.h:130
openvdb::v8_2::OPENVDB_LIBRARY_MAJOR_VERSION
const uint32_t OPENVDB_LIBRARY_MAJOR_VERSION
Definition: version.h:169
openvdb::v8_2::OPENVDB_FILE_VERSION_GRID_INSTANCING
@ OPENVDB_FILE_VERSION_GRID_INSTANCING
Definition: version.h:187
openvdb::v8_2::OPENVDB_FILE_VERSION_NEW_TRANSFORM
@ OPENVDB_FILE_VERSION_NEW_TRANSFORM
Definition: version.h:191
openvdb::v8_2::OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION
@ OPENVDB_FILE_VERSION_SELECTIVE_COMPRESSION
Definition: version.h:192
Platform.h
openvdb::v8_2::OPENVDB_MAGIC
const int32_t OPENVDB_MAGIC
The magic number is stored in the first four bytes of every VDB file.
Definition: version.h:165
openvdb::v8_2::VersionId
Definition: version.h:209
OPENVDB_LIBRARY_VERSION_NUMBER
#define OPENVDB_LIBRARY_VERSION_NUMBER
Library version number as a packed integer ("%02x%02x%04x", major, minor, patch)
Definition: version.h:134
openvdb::v8_2::VersionId::second
uint32_t second
Definition: version.h:210
openvdb::v8_2::getLibraryVersionString
constexpr const char * getLibraryVersionString()
Return a library version number string of the form "<major>.<minor>.<patch>".
Definition: version.h:202
openvdb::v8_2::OPENVDB_LIBRARY_VERSION
const uint32_t OPENVDB_LIBRARY_VERSION
Library version number as a packed integer ("%02x%02x%04x", major, minor, patch)
Definition: version.h:173
openvdb::v8_2::OPENVDB_LIBRARY_MINOR_VERSION
const uint32_t OPENVDB_LIBRARY_MINOR_VERSION
Definition: version.h:170
openvdb::v8_2::VersionId::VersionId
VersionId(uint32_t major, uint32_t minor)
Definition: version.h:212
openvdb::v8_2::OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION
@ OPENVDB_FILE_VERSION_INTERNALNODE_COMPRESSION
Definition: version.h:185
OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
#define OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER
Definition: version.h:51
OPENVDB_USE_VERSION_NAMESPACE
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:153
openvdb::v8_2::OPENVDB_FILE_VERSION
const uint32_t OPENVDB_FILE_VERSION
The current version number of the VDB file format.
Definition: version.h:180
openvdb::v8_2::VersionId::VersionId
VersionId()
Definition: version.h:211
openvdb::v8_2::OPENVDB_LIBRARY_PATCH_VERSION
const uint32_t OPENVDB_LIBRARY_PATCH_VERSION
Definition: version.h:171
openvdb::v8_2::OPENVDB_FILE_VERSION_BLOSC_COMPRESSION
@ OPENVDB_FILE_VERSION_BLOSC_COMPRESSION
Definition: version.h:195
OPENVDB_VERSION_NAME
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:101
OPENVDB_LIBRARY_MINOR_VERSION_NUMBER
#define OPENVDB_LIBRARY_MINOR_VERSION_NUMBER
Definition: version.h:52
openvdb::v8_2::OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
@ OPENVDB_FILE_VERSION_NODE_MASK_COMPRESSION
Definition: version.h:194
openvdb::v8_2::OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX
@ OPENVDB_FILE_VERSION_FLOAT_FRUSTUM_BBOX
Definition: version.h:193
openvdb
Definition: openvdb/Exceptions.h:13
openvdb::v8_2::OPENVDB_FILE_VERSION_BOOST_UUID
@ OPENVDB_FILE_VERSION_BOOST_UUID
Definition: version.h:189
openvdb::v8_2::OPENVDB_FILE_VERSION_NO_GRIDMAP
@ OPENVDB_FILE_VERSION_NO_GRIDMAP
Definition: version.h:190
openvdb::v8_2::OPENVDB_FILE_VERSION_MULTIPASS_IO
@ OPENVDB_FILE_VERSION_MULTIPASS_IO
Definition: version.h:197