From 82e0b734e5d28f96205de65fd2179e08fd91b1db Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 20 Oct 2021 08:56:39 -0700 Subject: ipc, rwcancel: compile on js/wasm Signed-off-by: Brad Fitzpatrick --- ipc/uapi_js.go | 15 +++++++++++++++ rwcancel/rwcancel.go | 2 +- rwcancel/rwcancel_stub.go | 10 ++++++++++ rwcancel/rwcancel_windows.go | 8 -------- 4 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 ipc/uapi_js.go create mode 100644 rwcancel/rwcancel_stub.go delete mode 100644 rwcancel/rwcancel_windows.go diff --git a/ipc/uapi_js.go b/ipc/uapi_js.go new file mode 100644 index 0000000..be36b5d --- /dev/null +++ b/ipc/uapi_js.go @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: MIT + * + * Copyright (C) 2021 WireGuard LLC. All Rights Reserved. + */ + +package ipc + +// Made up sentinel error codes for the js/wasm platform. +const ( + IpcErrorIO = 1 + IpcErrorInvalid = 2 + IpcErrorPortInUse = 3 + IpcErrorUnknown = 4 + IpcErrorProtocol = 5 +) diff --git a/rwcancel/rwcancel.go b/rwcancel/rwcancel.go index 59bbe57..c3b2299 100644 --- a/rwcancel/rwcancel.go +++ b/rwcancel/rwcancel.go @@ -1,4 +1,4 @@ -//go:build !windows +//go:build !windows && !js /* SPDX-License-Identifier: MIT * diff --git a/rwcancel/rwcancel_stub.go b/rwcancel/rwcancel_stub.go new file mode 100644 index 0000000..fae47b4 --- /dev/null +++ b/rwcancel/rwcancel_stub.go @@ -0,0 +1,10 @@ +//go:build windows || js + +// SPDX-License-Identifier: MIT + +package rwcancel + +type RWCancel struct { +} + +func (*RWCancel) Cancel() {} diff --git a/rwcancel/rwcancel_windows.go b/rwcancel/rwcancel_windows.go deleted file mode 100644 index 0316911..0000000 --- a/rwcancel/rwcancel_windows.go +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: MIT - -package rwcancel - -type RWCancel struct { -} - -func (*RWCancel) Cancel() {} -- cgit v1.2.3-54-g00ecf