From 678568a5cfe1806c16bf478234d6dac283c3474d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sat, 30 Jan 2021 16:18:51 -0500 Subject: [PATCH] runtime: delete windows setlasterror (unused) This is dead code and need not be ported to each architecture. This CL is part of a stack adding windows/arm64 support (#36439), intended to land in the Go 1.17 cycle. This CL is, however, not windows/arm64-specific. It is cleanup meant to make the port (and future ports) easier. Change-Id: I2d0072b377f73e49d7158ea304670c26f5486c59 Reviewed-on: https://go-review.googlesource.com/c/go/+/288794 Trust: Russ Cox Trust: Jason A. Donenfeld Reviewed-by: Alex Brainman Reviewed-by: Cherry Zhang Reviewed-by: Jason A. Donenfeld --- src/runtime/os_windows.go | 1 - src/runtime/sys_windows_386.s | 5 ----- src/runtime/sys_windows_amd64.s | 6 ------ src/runtime/sys_windows_arm.s | 5 ----- 4 files changed, 17 deletions(-) diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 1bf3309dfd..a2a124cd9d 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -379,7 +379,6 @@ const ( // in sys_windows_386.s and sys_windows_amd64.s: func externalthreadhandler() func getlasterror() uint32 -func setlasterror(err uint32) // When loading DLLs, we prefer to use LoadLibraryEx with // LOAD_LIBRARY_SEARCH_* flags, if available. LoadLibraryEx is not diff --git a/src/runtime/sys_windows_386.s b/src/runtime/sys_windows_386.s index b3972ac78d..c556e3a3c2 100644 --- a/src/runtime/sys_windows_386.s +++ b/src/runtime/sys_windows_386.s @@ -66,11 +66,6 @@ TEXT runtime·getlasterror(SB),NOSPLIT,$0 MOVL AX, ret+0(FP) RET -TEXT runtime·setlasterror(SB),NOSPLIT,$0 - MOVL err+0(FP), AX - MOVL AX, 0x34(FS) - RET - // Called by Windows as a Vectored Exception Handler (VEH). // First argument is pointer to struct containing // exception record and context pointers. diff --git a/src/runtime/sys_windows_amd64.s b/src/runtime/sys_windows_amd64.s index 2bd7b74848..9cd14016b0 100644 --- a/src/runtime/sys_windows_amd64.s +++ b/src/runtime/sys_windows_amd64.s @@ -103,12 +103,6 @@ TEXT runtime·getlasterror(SB),NOSPLIT,$0 MOVL AX, ret+0(FP) RET -TEXT runtime·setlasterror(SB),NOSPLIT,$0 - MOVL err+0(FP), AX - MOVQ 0x30(GS), CX - MOVL AX, 0x68(CX) - RET - // Called by Windows as a Vectored Exception Handler (VEH). // First argument is pointer to struct containing // exception record and context pointers. diff --git a/src/runtime/sys_windows_arm.s b/src/runtime/sys_windows_arm.s index 1d928a4f7d..d2bdc50e3b 100644 --- a/src/runtime/sys_windows_arm.s +++ b/src/runtime/sys_windows_arm.s @@ -103,11 +103,6 @@ TEXT runtime·getlasterror(SB),NOSPLIT,$0 MOVW R0, ret+0(FP) RET -TEXT runtime·setlasterror(SB),NOSPLIT|NOFRAME,$0 - MRC 15, 0, R1, C13, C0, 2 - MOVW R0, 0x34(R1) - RET - // Called by Windows as a Vectored Exception Handler (VEH). // First argument is pointer to struct containing // exception record and context pointers.