开发者

Using c99 in C++'s `extern "C"` blocks

开发者 https://www.devze.com 2023-01-15 22:51 出处:网络
I would like to have a function written in C, but callable from C++ which takes a restricted pointer. This is only available in c99, so g++ doe开发者_如何学Gosn\'t like it, even in extern \"C\" blocks

I would like to have a function written in C, but callable from C++ which takes a restricted pointer. This is only available in c99, so g++ doe开发者_如何学Gosn't like it, even in extern "C" blocks. How can I get around this limitation?


#ifdef __cplusplus
#   ifdef __GNUC__
#       define restrict __restrict__ // G++ has restrict
#   else
#       define restrict // C++ in general doesn't
#   endif
#endif
0

精彩评论

暂无评论...
验证码 换一张
取 消