]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add //go:build lines to files generated with with mksyscall_libc.pl
authorTobias Klauser <tklauser@distanz.ch>
Sat, 1 May 2021 13:37:44 +0000 (15:37 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Sun, 2 May 2021 21:24:28 +0000 (21:24 +0000)
Change-Id: I2e02d02d9208fc2dbf01c0cea4a67c288967cd07
Reviewed-on: https://go-review.googlesource.com/c/go/+/315276
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/mksyscall_libc.pl

index 5ceedc812a364c915a56b117d9e0b1645f40f6b6..631a07c819cbab63ff676258e5839df4830f537d 100755 (executable)
@@ -23,6 +23,7 @@ my $cmdline = "mksyscall_libc.pl " . join(' ', @ARGV);
 my $errors = 0;
 my $_32bit = "";
 my $tags = "";  # build tags
+my $newtags = ""; # new style build tags
 my $aix = 0;
 my $solaris = 0;
 
@@ -300,10 +301,14 @@ if($errors) {
        exit 1;
 }
 
+# TODO: this assumes tags are just simply comma separated. For now this is all the uses.
+$newtags = $tags =~ s/,/ && /r;
+
 print <<EOF;
 // $cmdline
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build $newtags
 // +build $tags
 
 package $package