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:
Right Patch Set: code review 4047047: runtime: generate Go defs for C types.
Use n/p to move between diff chunks;
N/P to move between comments.
Please Sign in to add in-line comments.
Jump to:
src/cmd/cc/godefs.c
src/cmd/ld/dwarf.c
src/pkg/runtime/Makefile
src/pkg/runtime/chan_defs.go
src/pkg/runtime/darwin/runtime_defs.go
src/pkg/runtime/extern.go
src/pkg/runtime/freebsd/runtime_defs.go
src/pkg/runtime/hashmap.h
src/pkg/runtime/hashmap.c
src/pkg/runtime/hashmap_defs.go
src/pkg/runtime/iface_defs.go
src/pkg/runtime/linux/runtime_defs.go
src/pkg/runtime/malloc_defs.go
src/pkg/runtime/mkgodefs.sh
src/pkg/runtime/plan9/runtime_defs.go
src/pkg/runtime/runtime.h
src/pkg/runtime/runtime-gdb.py
src/pkg/runtime/runtime_defs.go
src/pkg/runtime/type.h
src/pkg/runtime/type.go
src/pkg/runtime/windows/runtime_defs.go
LEFT RIGHT
(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 '
LEFT RIGHT