From 3787685e5a963b6cd74d2741811a66ec3e605cd4 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 1 Aug 2025 12:19:12 +0100 Subject: [PATCH] fix: Support building on unsupported Unix systems. --- enumerator_unsupported_unix.go | 17 +++++++++++++++++ serial_unsupported_unix.go | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 enumerator_unsupported_unix.go create mode 100644 serial_unsupported_unix.go diff --git a/enumerator_unsupported_unix.go b/enumerator_unsupported_unix.go new file mode 100644 index 0000000..2d908e1 --- /dev/null +++ b/enumerator_unsupported_unix.go @@ -0,0 +1,17 @@ +// +// Copyright 2014-2024 Cristian Maglie. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// + +//go:build !linux && !darwin && !freebsd && !openbsd + +package serial + +import ( + "errors" +) + +func nativeGetPortsList() ([]string, error) { + return nil, errors.New("nativeGetPortsList is not currently supported on this OS") +} diff --git a/serial_unsupported_unix.go b/serial_unsupported_unix.go new file mode 100644 index 0000000..ffdfc6c --- /dev/null +++ b/serial_unsupported_unix.go @@ -0,0 +1,17 @@ +// +// Copyright 2014-2024 Cristian Maglie. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// + +//go:build !linux && !darwin && !freebsd && !openbsd + +package serial + +import ( + "errors" +) + +func nativeOpen(portName string, mode *Mode) (Port, error) { + return nil, errors.New("nativeOpen is not currently supported on this OS") +}