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

I would like to have a function written in C, but called from C ++, which takes a limited pointer. This is only available in c99, so g ++ does not like it, even in blocks extern "C". How can I get around this limitation?

+3
source share
1 answer
#ifdef __cplusplus
#   ifdef __GNUC__
#       define restrict __restrict__ // G++ has restrict
#   else
#       define restrict // C++ in general doesn't
#   endif
#endif
+1
source

Source: https://habr.com/ru/post/1764258/


All Articles