summaryrefslogtreecommitdiffstats
path: root/gnu/gcc/0003-fix-header-generation-for-libgo.patch
blob: bef60d048f28ad62c6dd6f8a959c314689f2fc12 (plain) (blame)
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
32
33
34
35
36
From 6bcb304485fca4e6149a1bbd8085da2d42042d37 Mon Sep 17 00:00:00 2001
From: Florian Franzmann <siflfran@hawo.stw.uni-erlangen.de>
Date: Sun, 24 Feb 2013 12:00:25 +0100
Subject: [PATCH 3/3] fix header generation for libgo

---
 libgo/mksysinfo.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 315d60c..10c888c 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -538,7 +538,7 @@ if test "$rusage" != ""; then
   rusage=`echo $rusage | sed -e 's/^ *//'`
   nrusage=
   while test -n "$rusage"; do
-    field=`echo $rusage | sed -e 's/^\([^;]*\);.*$/\1/'`
+    field=`echo $rusage | sed -e 's/^\([^;]*\);.*$/\1/' -e 's/struct \(.*\)/struct { \1; }/'`
     rusage=`echo $rusage | sed -e 's/^[^;]*; *\(.*\)$/\1/'`
     # Drop the leading ru_, capitalize the next character.
     field=`echo $field | sed -e 's/^ru_//'`
@@ -550,7 +550,9 @@ if test "$rusage" != ""; then
     r=`echo $r | sed -e s'/ _timespec$/ Timespec/'`
     r=`echo $r | sed -e s'/ _timestruc_t$/ Timestruc/'`
     field="$f$r"
-    nrusage="$nrusage $field;"
+    if [ -n "$field" ]; then
+      nrusage="$nrusage $field;"
+    fi
   done
   echo "type Rusage struct {$nrusage }" >> ${OUT}
 else
-- 
1.8.1.3