Skip to content

Commit

Permalink
all: remove dependencies on golang.org/x/sys (#271)
Browse files Browse the repository at this point in the history
The example still has the dependency on golang.org/x/sys.

Updates #270
  • Loading branch information
hajimehoshi authored Aug 22, 2024
1 parent ebc2d33 commit 5905af5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 5 additions & 3 deletions internal/load/load_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

package load

import "golang.org/x/sys/windows"
import (
"syscall"
)

func OpenLibrary(name string) (uintptr, error) {
handle, err := windows.LoadLibrary(name)
handle, err := syscall.LoadLibrary(name)
return uintptr(handle), err
}

func OpenSymbol(lib uintptr, name string) (uintptr, error) {
return windows.GetProcAddress(windows.Handle(lib), name)
return syscall.GetProcAddress(syscall.Handle(lib), name)
}
4 changes: 1 addition & 3 deletions syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ package purego
import (
"reflect"
"syscall"

"golang.org/x/sys/windows"
)

var syscall15XABI0 uintptr
Expand Down Expand Up @@ -44,5 +42,5 @@ func NewCallback(fn interface{}) uintptr {
}

func loadSymbol(handle uintptr, name string) (uintptr, error) {
return windows.GetProcAddress(windows.Handle(handle), name)
return syscall.GetProcAddress(syscall.Handle(handle), name)
}

0 comments on commit 5905af5

Please sign in to comment.