Compile error when including "timer.h" from c++ source file.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

We are developing a timer wheel mechanism for our Linux application in c++ environment (Eclipse).

However, when including the file "timer.h" file from the Linux library, there is a compile error indicating a problem of using the word "new" in the file "list.h" (the compiler identify it as a key work in c++ instead of a function's parameter name):

 

In file included from /cygdrive/c/cygwin/usr/cross-linux/bin/../lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/sys-include/linux/timer.h:17,

                 from ../InfraTimerWheel.h:26,

                 from ../InfraTimerWheel.cc:15:

/cygdrive/c/cygwin/usr/cross-linux/bin/../lib/gcc/i686-pc-linux-gnu/3.4.1/../../../../i686-pc-linux-gnu/sys-include/linux/list.h:37: error: expected `,' or `...' before "new"

 

Line 37 In "list.h":

 

static __inline__ void __list_add(struct list_head * new,

            struct list_head * prev,

            struct list_head * next)

 

We tried to solve it by including "timer.h" in the following manner, but it did not work:

 

extern "C" {

#undef __cplusplus

  #include <linux/types.h>

  #include <linux/timer.h>

#define __cplusplus

}

 

Any suggestions?

 

Regards,

Yaniv.

 

 

_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/redhat-devel-list

[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux