The following macros confused me. I wondering what is __pragma and wwhat are the differences between __pragma and #pragma.
#define OPENVDB_START_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711))
#define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711))
#pragma
is a preprocessor directive in its own right; it can't be used within a #define
directive.
So, this is why __pragma
exists: it provides a way for a pragma to be issued from wherever the macro that uses it is expanded.
This is a non-standard compiler extension (MSVC, Intel, and some C compilers support it to varying degrees). See also the _Pragma
operator that is defined in newer versions of the C/C++ standards (and serves the same purpose, but with a slightly different syntax).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With