c++ - 预期的声明说明符或 '...' 之前的 'boolean'

标签 c++ c unix kernel linux-device-driver

下面是我的.h文件

4 typedef struct pic_ pic_t; 
5 typedef int32_t status_t; 
6 typedef u_int16_t pic_id_t; 
7 typedef const char* (*pic_flavor_t) (pic_t *); 
8 typedef status_t (*pic_periodic_t) (pic_t *); 
9 typedef status_t (*pic_get_port_info_t) (pic_t *pic, u_int16_t link, void*info, Boolean*need_update); 
11 struct pic_ 
12 { 
13 u_int16_t   nic_slot; 
14 u_int16_t   pic_slot; 
15 u_int32_t   pic_flags; 
16 pic_id_t    pic_id; 
17 u_int16_t   pic_asic_type; 
18 u_int16_t   pic_firstport; 
19 pic_periodic_t  pic_periodic; 
20 pic_flavor_t    pic_flavor; 
21 pic_get_port_info_t pic_get_port_info; 
22 void *pic_context; 
23 };

我收到以下错误

../../../../../src/pfe/common/drivers/rpio/rpio_tunnel_pvt1.h:9: error: expected     declaration specifiers or '...' before 'boolean'

我试过包括 还尝试用 bool 和 _bool 替换 booleand 仍然没有帮助。 有人请帮帮我

最佳答案

Booleanboolean 都不存在于 Linux 内核头文件中。

但是,linux/types.h 中定义了一个bool作为

typedef _Bool           bool;

要访问它,您必须将 boolean 更改为 bool 并在您的源代码中包含 linux/types.h

关于c++ - 预期的声明说明符或 '...' 之前的 'boolean',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23241900/

相关文章:

c - recvmsg() 不支持操作

shell - 找到所有的 zip,并解压到位 - Unix

c++ - 寻找 : C/C++ Regex library that supports Named Captures

c++ - GC 如何知道要释放哪个内存?

c - IAR <time.h>、本地时间、mktime

C 虚拟地址到物理地址的映射

python - 在 python 中调用外部程序,观察特定文本的输出然后采取行动

c++ - 模板函数不会编译

c++ - Sqlite3 ORM for C++ 实现延迟加载

c - Makefile - 错误的编译顺序