summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Klausner <wiz@NetBSD.org>2018-04-23 14:56:17 -0400
committerAdam Jackson <ajax@redhat.com>2018-04-23 14:56:17 -0400
commit8275903956d7876519fa55fb805669dc301bf243 (patch)
tree77e83031835036678930789499ddc8b1dc9d7fcc
parente29d783278608544a208f211231a6a3ad2f8fa09 (diff)
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 <ajax@redhat.com>
-rwxr-xr-xhw/xfree86/sdksyms.sh11
1 files changed, 11 insertions, 0 deletions
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(...)