Use in_addr in ip_mreq_source and ip_msfilter.
This adds a new mechanism to say "replace struct S with #include <bits/S.h>".
Also switch epoll_event over to the new mechanism.
Also use the kernel's struct sockaddr_storage directly rather than behind
an unnecessary #define.
This patch also removes some dead code in the header scrubber. This code
still needs rewriting completely. I learned that a "block" isn't necessarily
a single struct definition, say; it might be a run of them. It seems like
a block is a run of preprocessor directives or a run of regular code.
Bug: https://issuetracker.google.com/36987220
Test: new test
Change-Id: Ic6a5c09559766a4babe3cd4c3ea538b885e07308
diff --git a/libc/kernel/tools/clean_header.py b/libc/kernel/tools/clean_header.py
index d63ea03..7c802c2 100755
--- a/libc/kernel/tools/clean_header.py
+++ b/libc/kernel/tools/clean_header.py
@@ -94,11 +94,9 @@
# Extract the architecture if found.
arch = None
- statics = kernel_known_generic_statics
m = re.search(r"(^|/)asm-([\w\d_\+\.\-]+)/.*", rel_path)
if m and m.group(2) != 'generic':
arch = m.group(2)
- statics = statics.union(kernel_known_statics.get(arch, set()))
# Now, let's parse the file.
parser = cpp.BlockParser()
@@ -116,9 +114,8 @@
blocks.optimizeMacros(macros)
blocks.optimizeIf01()
- blocks.removeVarsAndFuncs(statics)
+ blocks.removeVarsAndFuncs(kernel_known_generic_statics)
blocks.replaceTokens(kernel_token_replacements)
- blocks.removeMacroDefines(kernel_ignored_macros)
out = StringOutput()
out.write(kernel_disclaimer)