Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(80)

Delta Between Two Patch Sets: src/pkg/runtime/mkgodefs.sh

Issue 4047047: code review 4047047: runtime: automaticaly generated Go declarations for C v... (Closed)
Left Patch Set: Created 14 years, 1 month ago
Right Patch Set: code review 4047047: runtime: generate Go defs for C types. Created 14 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/malloc_defs.go ('k') | src/pkg/runtime/plan9/runtime_defs.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 #!/bin/sh
2 # Copyright 2011 The Go Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file.
5
6 set -e
7
8 cat <<EOF
9 // Go definitions for C variables and types.
10 // AUTOMATICALLY GENERATED BY THE FOLLOWING COMMAND. DO NOT EDIT.
11 // CC="$CC" CFLAGS="$CFLAGS" ./mkgodefs.sh $@
12
13 package runtime
14 import "unsafe"
15 var _ unsafe.Pointer
16
17 EOF
18
19 for i in "$@"; do
20 $CC $CFLAGS -q $i
21 done | awk '
22 /^func/ { next }
23 /^const/ { next }
24 /^\/\/.*type/ { next }
25
26 /^(const|func|type|var) / {
27 if(seen[$2]++) {
28 skip = /{[^}]*$/;
29 next;
30 }
31 }
32
33 skip {
34 skip = !/^}/
35 next;
36 }
37
38 {print}
39 '
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b