]> Cypherpunks repositories - gostls13.git/commit
cmd/dist: fix line numbers in goc2c generated files
authorAnthony Martin <ality@pbrane.org>
Tue, 23 Apr 2013 23:02:50 +0000 (16:02 -0700)
committerAnthony Martin <ality@pbrane.org>
Tue, 23 Apr 2013 23:02:50 +0000 (16:02 -0700)
commitd33f09bcc0814d900510c23ad5285b3a7c3b2e5c
treed53712f81ac73e1071cf43632b8a9ad5ec951e08
parent7bec1a6033d92e140a255c1093d587c3927e1ab9
cmd/dist: fix line numbers in goc2c generated files

We have to reset the global lineno variable before
processing each file otherwise line numbers will be
offset by the number of lines in the previous file.

The following examples are from the beginning of the
ztime_linux_amd64.c file which is generated from
time.goc in the runtime package.

Before:
    #line 2483 "/home/apm/src/go/src/pkg/runtime/time.goc"
    static Timers timers;
    static void addtimer ( Timer* ) ;
    void
    time·Sleep(int64 ns)
    {
    #line 2492 "/home/apm/src/go/src/pkg/runtime/time.goc"

After:
    #line 16 "/home/apm/src/go/src/pkg/runtime/time.goc"
    static Timers timers;
    static void addtimer ( Timer* ) ;
    void
    time·Sleep(int64 ns)
    {
    #line 25 "/home/apm/src/go/src/pkg/runtime/time.goc"

R=golang-dev, minux.ma, iant, r, adg
CC=golang-dev
https://golang.org/cl/8653045
src/cmd/dist/goc2c.c