Skip to content

Commit 136f282

Browse files
miguelinuxrafaeljw
authored andcommitted
ACPI: tools: fix compilation error
When ACPI tools are compiled, the following error is showed: $ cd tools/power/acpi $ make DESCEND tools/acpidbg MKDIR include CP include CC tools/acpidbg/acpidbg.o In file included from /home/linux/tools/power/acpi/include/acpi/platform/acenv.h:152, from /home/linux/tools/power/acpi/include/acpi/acpi.h:22, from acpidbg.c:9: /home/linux/tools/power/acpi/include/acpi/platform/acgcc.h:25:10: fatal error: linux/stdarg.h: No such file or directory 29 | #include <linux/stdarg.h> | ^~~~~~~~~~~~~~~~ compilation terminated. Use the ACPICA logic: just identify when it is used inside the kernel or by an ACPI tool. Fixes: c0891ac ("isystem: ship and use stdarg.h") Signed-off-by: Miguel Bernal Marin <[email protected]> [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 9e1ff30 commit 136f282

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

include/acpi/platform/acgcc.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ typedef __builtin_va_list va_list;
2222
#define va_arg(v, l) __builtin_va_arg(v, l)
2323
#define va_copy(d, s) __builtin_va_copy(d, s)
2424
#else
25+
#ifdef __KERNEL__
2526
#include <linux/stdarg.h>
26-
#endif
27-
#endif
27+
#else
28+
/* Used to build acpi tools */
29+
#include <stdarg.h>
30+
#endif /* __KERNEL__ */
31+
#endif /* ACPI_USE_BUILTIN_STDARG */
32+
#endif /* ! va_arg */
2833

2934
#define ACPI_INLINE __inline__
3035

0 commit comments

Comments
 (0)