]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: use //go:build lines in C and assembly files
authorTobias Klauser <tklauser@distanz.ch>
Tue, 24 Jan 2023 09:16:42 +0000 (10:16 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 24 Jan 2023 22:38:02 +0000 (22:38 +0000)
Replace deprecated // +build lines by their respective //go:build line
counterpart. Also remove build constraints implied by file name or type.

Change-Id: I8d18cd40071ca28d7654da8f0d22841f43729ca6
Reviewed-on: https://go-review.googlesource.com/c/go/+/460538
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
24 files changed:
src/runtime/cgo/asm_mips64x.s
src/runtime/cgo/asm_mipsx.s
src/runtime/cgo/asm_ppc64x.s
src/runtime/cgo/gcc_aix_ppc64.S
src/runtime/cgo/gcc_aix_ppc64.c
src/runtime/cgo/gcc_context.c
src/runtime/cgo/gcc_fatalf.c
src/runtime/cgo/gcc_freebsd_sigaction.c
src/runtime/cgo/gcc_libinit.c
src/runtime/cgo/gcc_libinit_windows.c
src/runtime/cgo/gcc_linux_mips64x.c
src/runtime/cgo/gcc_linux_mipsx.c
src/runtime/cgo/gcc_linux_ppc64x.S
src/runtime/cgo/gcc_mips64x.S
src/runtime/cgo/gcc_mipsx.S
src/runtime/cgo/gcc_mmap.c
src/runtime/cgo/gcc_ppc64x.c
src/runtime/cgo/gcc_setenv.c
src/runtime/cgo/gcc_sigaction.c
src/runtime/cgo/gcc_signal2_ios_arm64.c
src/runtime/cgo/gcc_signal_ios_arm64.c
src/runtime/cgo/gcc_signal_ios_nolldb.c
src/runtime/cgo/gcc_traceback.c
src/runtime/cgo/linux_syscall.c

index ba948071fa9cca1703cf18d1f04e46072f6d81bd..904f781d87eaf07bf5ab326d3446056e3924731b 100644 (file)
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build mips64 || mips64le
-// +build mips64 mips64le
 
 #include "textflag.h"
 
index fd5d78ef97abef3cfd1909e44d41c3c4f4a4918d..5e2db0b56ecbe38190a9bad67d40bf20bc92c37d 100644 (file)
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build mips || mipsle
-// +build mips mipsle
 
 #include "textflag.h"
 
index 187b2d42f630d34c68f8cd90cfcf6bff3ef43260..c20100504443ca0f1d8b2e4c6f553836944336aa 100644 (file)
@@ -3,7 +3,6 @@
 // license that can be found in the LICENSE file.
 
 //go:build ppc64 || ppc64le
-// +build ppc64 ppc64le
 
 #include "textflag.h"
 #include "asm_ppc64x.h"
index a77363ee25002b902ba784e04d593d6d9c58a503..6f465f0a1d0184f39c77d1201fc5af0d3f922af7 100644 (file)
@@ -2,9 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build ppc64
-// +build aix
-
 .file "gcc_aix_ppc64.S"
 
 /*
index f4f50b89ce0411cea1a372918231255b1f68c93b..9dd9524853b71e059926dcc639b31429fca52e8d 100644 (file)
@@ -2,9 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build aix
-// +build ppc64 ppc64le
-
 /*
  * On AIX, call to _cgo_topofstack and Go main are forced to be a longcall.
  * Without it, ld might add trampolines in the middle of .text section
index 5fc0abb8bc264300eb642d4b2773365081b9fdf2..ad586928219609e55aca205e03494e48511bc920 100644 (file)
@@ -2,8 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows
+//go:build unix || windows
 
 #include "libcgo.h"
 
index 597e750f128b326f2de08f4fa962a126cd5fe9e0..9493dbb4b06ce2924f3b62598e3cdd4fc4cd7352 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build aix !android,linux freebsd
+//go:build aix || (!android && linux) || freebsd
 
 #include <stdarg.h>
 #include <stdio.h>
index 98b122d75ec609dfb95297f27129a57b7fc4fd21..b324983771ee85b2ac47c11918e2b5f386860587 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build freebsd,amd64
+//go:build freebsd && amd64
 
 #include <errno.h>
 #include <stddef.h>
index 3304d95fdf968408908f27d3b8592294b97cf528..57620fe4de81eda8f075af0d939b9013c7197cf0 100644 (file)
@@ -2,8 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+//go:build unix
 
 #include <pthread.h>
 #include <errno.h>
index 2b5896bb221c6c1cade68ec1b6b13dbc56e5ee53..fdcf027424b6db28aef9dda6ec7620d3aded5dc8 100644 (file)
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
-
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <process.h>
index 3ea29b0f86a1c60de2b55fbd4a38ac07c68bafa7..fbe199a67817aef1a6b3d1f0a89cc424cb103a7d 100644 (file)
@@ -2,9 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
-// +build linux
-// +build mips64 mips64le
+//go:build mips64 || mips64le
 
 #include <pthread.h>
 #include <string.h>
index 3b60a0ea5899b426951d3250cc5540489deeada3..781afc097dfb8da9df820e99366d08c5704c7f94 100644 (file)
@@ -2,9 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
-// +build linux
-// +build mips mipsle
+//go:build mips || mipsle
 
 #include <pthread.h>
 #include <string.h>
index 957ef3ab1bd3cf15aa219a7222b0599e60991473..5c8b3e70bb02e650a4b819607f5501948dc6b196 100644 (file)
@@ -2,8 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build ppc64 ppc64le
-// +build linux
+//go:build linux && (ppc64 || ppc64le)
 
 .file "gcc_linux_ppc64x.S"
 
index ec24d7199c2204bc2f8c4a42e9925cb92bd65b9f..1629e47235e284ee5a898a84c658a09927a2a870 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build mips64 mips64le
+//go:build mips64 || mips64le
 
 .file "gcc_mips64x.S"
 
index 2867f6a0527749a864aa404eb5ac16b3ea68ce65..fb19c11702373c427e202cc00426fdeeceaf3e72 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build mips mipsle
+//go:build mips || mipsle
 
 .file "gcc_mipsx.S"
 
index 83d857f0d155e220230295219b8f188410c276ac..1fbd5e82a4dae9b31d410b7f0013eb9ee7064906 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build linux,amd64 linux,arm64 linux,ppc64le freebsd,amd64
+//go:build (linux && (amd64 || arm64 || ppc64le)) || (freebsd && amd64)
 
 #include <errno.h>
 #include <stdint.h>
index 9cb6e0ce4ba575de58a5bf63879bd07db333f851..7e34fe4e02855573a36242bef4201c5b1f9d2e89 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build ppc64 ppc64le
+//go:build ppc64 || ppc64le
 
 #include <pthread.h>
 #include <string.h>
index d4f798357af35c19ef3117c458106577fad486db..47caa4b00ae9a7c06a54ea77d64571c2f811d760 100644 (file)
@@ -2,8 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+//go:build unix
 
 #include "libcgo.h"
 
index fcf1e50740e855765a2ff471472e8e3fdca53cc5..374909bf9768e171e6e12bc181db95400ea017ba 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build linux,amd64 linux,arm64 linux,ppc64le
+//go:build linux && (amd64 || arm64 || ppc64le)
 
 #include <errno.h>
 #include <stddef.h>
index 5b8a18ffd618d5b6b4e5f6305be2622717f3e68b..f8cef54f6a4006752ed9b9e4ad566edcaeb66e47 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build lldb
+//go:build lldb
 
 // Used by gcc_signal_darwin_arm64.c when doing the test build during cgo.
 // We hope that for real binaries the definition provided by Go will take precedence
index 6519edd4cccd7c7c82b1931782062c5c4af9a77a..87055e9422432a762ad098cbde46de0109c877d4 100644 (file)
@@ -17,7 +17,7 @@
 //
 // The dist tool enables this by build flag when testing.
 
-// +build lldb
+//go:build lldb
 
 #include <limits.h>
 #include <pthread.h>
index cfa402541465313c67d4fcc65df10b84ef81e69e..9ddc37a013bef55d0a1f99acbd88592e10e487b7 100644 (file)
@@ -2,9 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !lldb
-// +build ios
-// +build arm64
+//go:build !lldb && ios && arm64
 
 #include <stdint.h>
 
index 6e9470c43c24ada65f16ac115f4a51c41c97de94..053430047bf0d8025f1a7688a8efadaa18009481 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build cgo,darwin cgo,linux
+//go:build darwin || linux
 
 #include <stdint.h>
 #include "libcgo.h"
index 59761c8b409ef2f5da5121dae80fb26374fe3157..0ea2da719a982f39acb84be19997566052755374 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build linux
+//go:build linux
 
 #ifndef _GNU_SOURCE // setres[ug]id() API.
 #define _GNU_SOURCE