summaryrefslogtreecommitdiff
blob: 97030d8627ec2759410142844bbe63a8163e07fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From d0b2a4c294ed17e66c42bd65bf7272e599c558b9 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Mon, 29 Dec 2008 06:07:47 -0500
Subject: [PATCH] kbuild: auto-convert size types in userspace headers

Rather than constantly fixing up size type breakage in userspace headers,
auto convert the types u_intXX_t, uintXX_t, intXX_t, uXX, and sXX to the
appropriate __uXX or __sXX type.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 scripts/headers_install.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index 581ca99..1c801a5 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -42,6 +42,9 @@ foreach my $filename (@files) {
 		$line =~ s/(^|\s)(inline)\b/$1__$2__/g;
 		$line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
 		$line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
+		$line =~ s/\b([us](8|16|32|64))\b/__$1/g;
+		$line =~ s/\b(u_?int(8|16|32|64)_t)\b/__u$2/g;
+		$line =~ s/\b(int(8|16|32|64)_t)\b/__s$2/g;
 		$line =~ s/#ifndef\s+_UAPI/#ifndef /;
 		$line =~ s/#define\s+_UAPI/#define /;
 		$line =~ s!#endif\s+/[*]\s*_UAPI!#endif /* !;
-- 
1.8.2.1