我尝试编译一些库并得到错误:
In file included from *************************:
F:/include/strutils.h:40:37: error: expected ';', ',' or ')' before 'dest'
extern void *mempcpy(void *restrict dest, const void *restrict src, size_t n);
这是strutils.h:
#ifndef HAVE_MEMPCPY
extern void *mempcpy(void *restrict dest, const void *restrict src, size_t n);
#endif
怎么了
它不识别限制一词。
如果它是C文件,则可能需要指定一个命令行开关来告诉它识别C99关键字。https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
或者,
#define restrict
或可能
#define restrict __restrict__
如果.cpp文件中包含strutils.h:C ++没有对的标准支持,但是许多编译器具有通常在C ++和C中都可以使用的等效项,例如GNU Compiler Collectionrestrict
__restrict__
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句