]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
ipc, rwcancel: compile on js/wasm
authorBrad Fitzpatrick <bradfitz@tailscale.com>
Wed, 20 Oct 2021 15:56:39 +0000 (08:56 -0700)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 20 Oct 2021 20:50:05 +0000 (14:50 -0600)
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
ipc/uapi_js.go [new file with mode: 0644]
rwcancel/rwcancel.go
rwcancel/rwcancel_stub.go [moved from rwcancel/rwcancel_windows.go with 80% similarity]

diff --git a/ipc/uapi_js.go b/ipc/uapi_js.go
new file mode 100644 (file)
index 0000000..be36b5d
--- /dev/null
@@ -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
+)
index 59bbe57d9ca9d7c3da8f5c7b8c42dbbf74317e77..c3b229991753ac45ad296c99e9ab0e9370fe1e0a 100644 (file)
@@ -1,4 +1,4 @@
-//go:build !windows
+//go:build !windows && !js
 
 /* SPDX-License-Identifier: MIT
  *
similarity index 80%
rename from rwcancel/rwcancel_windows.go
rename to rwcancel/rwcancel_stub.go
index 031691130dd0a0498c93bb391a3abcd921b893ae..fae47b4e4ad5511f37b49e56513e6ef8ac8d1cbe 100644 (file)
@@ -1,3 +1,5 @@
+//go:build windows || js
+
 // SPDX-License-Identifier: MIT
 
 package rwcancel