I've attached a revised patch that uses the START_EXTERN_C and END_EXTERN_C macros. It's functionally identical to the previous patch but more consistent with how such things are done elsewhere in the core.
Re: [perl #112784] perlbug AutoReply: mathoms broken under C++
by Craig A. Berry