3

Some simple preprocessor code in Linux Kernel module gives the following error:

missing binary operator before token "("

The code:

#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 didn't help.

red0ct
  • 4,840
  • 3
  • 17
  • 44
z0lupka
  • 236
  • 4
  • 19

1 Answers1

6

that error means KERNEL_VERSION is not defined

you missed to #include <linux/version.h>


Edit

About kernel version see also : Is there a macro definition to check the Linux kernel version?

bruno
  • 32,421
  • 7
  • 25
  • 37