What is __pragma and what are the differences between __pragma and #pragma

前端 未结 1 991
走了就别回头了
走了就别回头了 2020-12-21 03:44

The following macros confused me. I wondering what is __pragma and wwhat are the differences between __pragma and #pragma.

#define OPENVDB_START_THREADSAFE_S         


        
相关标签:
1条回答
  • 2020-12-21 03:53

    #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).

    0 讨论(0)
提交回复
热议问题