From 8275903956d7876519fa55fb805669dc301bf243 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Mon, 23 Apr 2018 14:56:17 -0400 Subject: [PATCH] sdksyms: Cope with __pid_t and __uint32_t Kludge sdksyms.c generator to not fail on GetClientPid. It returns pid_t which on NetBSD is #define pid_t __pid_t This slightly alters the GCC preprocessor output which this fragile code could not deal with when using GCC 5+ Signed-off-by: Adam Jackson --- hw/xfree86/sdksyms.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index fc171d918..7897aae22 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -373,6 +373,17 @@ BEGIN { n = 1; } } + # hack: pid_t becomes __pid_t on NetBSD, same for uint32_t -> __uint32_t. + # GCC 5 inserts additional lines around this. + if (($1 == "__pid_t" || $1 == "__uint32_t") && NF == 1) { + getline; + n++; + # skip line numbers GCC 5 adds (after typedef return type?) + while ($n == "" || $0 ~ /^# [0-9]+ "/) { + getline; + n = 1; + } + } # type specifier may not be set, as in # extern _X_EXPORT unsigned name(...)