OpenVDB  9.0.1
Macros
Platform.h File Reference

Go to the source code of this file.

Macros

#define PRAGMA(x)   _Pragma(#x)
 
#define OPENVDB_CHECK_GCC(MAJOR, MINOR)   0
 Macro for determining if GCC version is >= than X.Y. More...
 
#define OPENVDB_HAS_CXX11   1
 OpenVDB now requires C++11. More...
 
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
 SIMD Intrinsic Headers. More...
 
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
 
#define OPENVDB_DEPRECATED   [[deprecated]]
 
#define OPENVDB_DEPRECATED_MESSAGE(msg)   [[deprecated(msg)]]
 
#define OPENVDB_NO_DEPRECATION_WARNING_BEGIN
 Bracket code with OPENVDB_NO_DEPRECATION_WARNING_BEGIN/_END, to inhibit warnings about deprecated code. More...
 
#define OPENVDB_NO_DEPRECATION_WARNING_END
 
#define OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
 Bracket code with OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN/_END, to inhibit warnings about type conversion. More...
 
#define OPENVDB_NO_TYPE_CONVERSION_WARNING_END
 
#define OPENVDB_TEMPLATE_IMPORT
 Helper macros for defining library symbol visibility. More...
 
#define OPENVDB_TEMPLATE_EXPORT
 
#define OPENVDB_API   OPENVDB_IMPORT
 
#define OPENVDB_HOUDINI_API   OPENVDB_IMPORT
 
#define OPENVDB_START_THREADSAFE_STATIC_REFERENCE
 
#define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE
 
#define OPENVDB_START_THREADSAFE_STATIC_WRITE
 
#define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE
 
#define OPENVDB_START_THREADSAFE_STATIC_ADDRESS
 
#define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS
 
#define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE
 
#define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE
 
#define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE
 
#define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE
 
#define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS
 
#define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS
 
#define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE)   CODE
 
#define OPENVDB_THREADSAFE_STATIC_WRITE(CODE)   CODE
 
#define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE)   CODE
 
Utilities
#define OPENVDB_PREPROC_STRINGIFY(x)
 Return x as a string literal. If x is a macro, return its value as a string literal. More...
 
#define OPENVDB_PREPROC_CONCAT(x, y)
 Form a new token by concatenating two existing tokens. If either token is a macro, concatenate its value. More...
 

Macro Definition Documentation

#define OPENVDB_API   OPENVDB_IMPORT

All classes and public free standing functions must be explicitly marked as <lib>_API to be exported. The <lib>_PRIVATE macros are defined when building that particular library.

#define OPENVDB_CHECK_GCC (   MAJOR,
  MINOR 
)    0

Macro for determining if GCC version is >= than X.Y.

#define OPENVDB_DEPRECATED   [[deprecated]]

Deprecation macros. Define OPENVDB_NO_DEPRECATION_WARNINGS to disable all deprecation warnings in OpenVDB.

#define OPENVDB_DEPRECATED_MESSAGE (   msg)    [[deprecated(msg)]]
#define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS
#define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE
#define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE
#define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS
#define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE
#define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE
#define OPENVDB_HAS_CXX11   1

OpenVDB now requires C++11.

#define OPENVDB_HOUDINI_API   OPENVDB_IMPORT
#define OPENVDB_NO_DEPRECATION_WARNING_BEGIN

Bracket code with OPENVDB_NO_DEPRECATION_WARNING_BEGIN/_END, to inhibit warnings about deprecated code.

Note
Use this sparingly. Remove references to deprecated code if at all possible.

Example:

1 OPENVDB_DEPRECATED void myDeprecatedFunction() {}
2 
3 {
4  OPENVDB_NO_DEPRECATION_WARNING_BEGIN
5  myDeprecatedFunction();
6  OPENVDB_NO_DEPRECATION_WARNING_END
7 }
#define OPENVDB_NO_DEPRECATION_WARNING_END
#define OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN

Bracket code with OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN/_END, to inhibit warnings about type conversion.

Note
Use this sparingly. Use static casts and explicit type conversion if at all possible.

Example:

1 float value = 0.1f;
2 OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
3 int valueAsInt = value;
4 OPENVDB_NO_TYPE_CONVERSION_WARNING_END
#define OPENVDB_NO_TYPE_CONVERSION_WARNING_END
#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN

SIMD Intrinsic Headers.

Windows defines Bracket code with OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN/_END, as in the following example, to inhibit ICC remarks about unreachable code:

1 template<typename NodeType>
2 void processNode(NodeType& node)
3 {
4  OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN
5  if (NodeType::LEVEL == 0) return; // ignore leaf nodes
6  int i = 0;
7  ...
8  OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
9 }

In the above, NodeType::LEVEL == 0 is a compile-time constant expression, so for some template instantiations, the line below it is unreachable.

#define OPENVDB_NO_UNREACHABLE_CODE_WARNING_END
#define OPENVDB_PREPROC_CONCAT (   x,
 
)

Form a new token by concatenating two existing tokens. If either token is a macro, concatenate its value.

#define OPENVDB_PREPROC_STRINGIFY (   x)

Return x as a string literal. If x is a macro, return its value as a string literal.

#define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS
#define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE
#define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE
#define OPENVDB_START_THREADSAFE_STATIC_ADDRESS
#define OPENVDB_START_THREADSAFE_STATIC_REFERENCE
#define OPENVDB_START_THREADSAFE_STATIC_WRITE
#define OPENVDB_TEMPLATE_EXPORT
#define OPENVDB_TEMPLATE_IMPORT

Helper macros for defining library symbol visibility.

Helper macros for explicit template instantiation

#define OPENVDB_THREADSAFE_STATIC_ADDRESS (   CODE)    CODE
#define OPENVDB_THREADSAFE_STATIC_REFERENCE (   CODE)    CODE
#define OPENVDB_THREADSAFE_STATIC_WRITE (   CODE)    CODE
#define PRAGMA (   x)    _Pragma(#x)