From c9205dba43c45dc5a185aa26e1160c3f62e9b471 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Wed, 8 Dec 2010 11:39:05 +0100 Subject: [PATCH] Replace all occurrances of asm with __asm__ in the output headers asm() conflicts with userland code compiled with -std=c99, the userland libc should only use __asm__() instead. Therefore, this transformation has to be applied to all exported headers. This only changes arch-arm/asm/byteorder.h. Change-Id: I1cf88c37201c3a91668d387293a18885c316d53c --- libc/kernel/tools/clean_header.py | 1 + libc/kernel/tools/defaults.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/libc/kernel/tools/clean_header.py b/libc/kernel/tools/clean_header.py index 28cb05ec5..dad91206e 100755 --- a/libc/kernel/tools/clean_header.py +++ b/libc/kernel/tools/clean_header.py @@ -71,6 +71,7 @@ def cleanupFile( path ): list.removeEmptyLines() list.removeMacroDefines( kernel_ignored_macros ) list.insertDisclaimer( kernel.kernel_disclaimer ) + list.replaceTokens( kernel_token_replacements ) out = StringOutput() list.write(out) diff --git a/libc/kernel/tools/defaults.py b/libc/kernel/tools/defaults.py index b35f72b5a..ca7e6bb4a 100644 --- a/libc/kernel/tools/defaults.py +++ b/libc/kernel/tools/defaults.py @@ -43,6 +43,11 @@ kernel_default_arch_macros = { "x86": {"__i386__": "1"}, } +# Replace tokens in the output according to this mapping +kernel_token_replacements = { + {"asm": "__asm__"}, + } + # this is the set of known static inline functions that we want to keep # in the final ARM headers. this is only used to keep optimized byteswapping # static functions and stuff like that. -- 2.11.0