If you add GV_ADD in place of the 0 as the second argument to get_sv(), then you shouldn't need to pre-declare or initialise MyModule::CONSTANT_NAME in the Perl code, as it will be created for you.
As for caveats with regard to threading; as it is a constant, there should be none.
In reply to Re: XS: exposing C++ library constant as package variable
by BrowserUk
in thread XS: exposing C++ library constant as package variable
by wisnij
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |