linux - 在 Linux 内核中, header 包含错误

标签 linux macros header kernel

当我在内核的源代码中包含“asm/xen/hypercall.h”时,

我收到一条错误消息。我该如何解决?

 include/linux/stddef.h:8:16: error: expected identifier or '(' before 'void'
 #define NULL ((void *)0)
                ^
./arch/x86/include/asm/alternative.h:221:28: note: in expansion of macro 'NULL'
 #define __parainstructions NULL
                            ^
./arch/x86/include/asm/paravirt_types.h:703:35: note: in expansion of macro '__parainstructions'
 extern struct paravirt_patch_site __parainstructions[],
                                   ^
include/linux/stddef.h:8:23: error: expected ')' before numeric constant
 #define NULL ((void *)0)
                       ^
./arch/x86/include/asm/alternative.h:221:28: note: in expansion of macro 'NULL'
 #define __parainstructions NULL
                            ^
./arch/x86/include/asm/paravirt_types.h:703:35: note: in expansion of macro '__parainstructions'
 extern struct paravirt_patch_site __parainstructions[],
                                   ^
scripts/Makefile.build:257: recipe for target 'drivers/oxen/fallback.o' failed

最佳答案

XEN 功能依赖于 PARAVIRT(参见 arch/x86/xen/Kconfig)。

但行

#define __parainstructions NULL

at arch/x86/include/asm/alternative.h:221 仅在 PARAVIRT 被禁用时执行。因此,在这种情况下,您不应该使用 XEN header 。

关于linux - 在 Linux 内核中, header 包含错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30321000/

相关文章:

linux - 删除包含在另一个文件中任何位置找到的模式的行

linux - 如何从命令输出生成交互式 'dialog' list ?

ios - Objective-C 系统宏中的下划线命名约定

c - 使用宏定义两个局部变量但具有相同的地址

c++ - 我的静态函数的 header 和 .cpp 发生了什么?仅在 header 中定义时运行

linux - 在 Azure NEW 门户中捕获 Linux VM

php - curl - 等待几秒钟后获取重定向网址

ios - 取 NSString 占位符的 C 函数宏

pdf - 删除 Rmarkdown 中 PDF 报告的章节标题

php - laravel 4:为什么 Request::header() 没有得到指定的 header ?