Linux Kernel error: missing binary operator before token "("
Linux Kernel error: missing binary operator before token "("
Linux 内核模块中的一些简单预处理器代码给出了以下错误:
missing binary operator before token "("
代码:
#if defined(AAA) || defined(BBB)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,13,0)
#define SOME 111
#else
#define SOME 222
#endif
#define OTHER 999
#else
#define SOME 1
#define OTHER 9
#endif /* AAA || BBB */
That post 没有帮助。
该错误表示 KERNEL_VERSION 未定义
你错过了 #include <linux/version.h>
编辑
关于内核版本另见:Is there a macro definition to check the Linux kernel version?
Linux 内核模块中的一些简单预处理器代码给出了以下错误:
missing binary operator before token "("
代码:
#if defined(AAA) || defined(BBB)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,13,0)
#define SOME 111
#else
#define SOME 222
#endif
#define OTHER 999
#else
#define SOME 1
#define OTHER 9
#endif /* AAA || BBB */
That post 没有帮助。
该错误表示 KERNEL_VERSION 未定义
你错过了 #include <linux/version.h>
编辑
关于内核版本另见:Is there a macro definition to check the Linux kernel version?