tiancaiamao / shen-go

A Go implementation of the Shen programming language
Other
55 stars 4 forks source link

*: compile on OpenBSD #40

Closed mndrix closed 2 years ago

mndrix commented 2 years ago

OpenBSD's syscall package doesn't define MAP_ANONYMOUS, but it does define the MAP_ANON alias. Using MAP_ANON allows shen-go to compile on OpenBSD and Linux.

If I'm reading go/src/syscall/zerrors_*.go correctly, this should also allow shen-go to compile on NetBSD, DragonflyBSD, and Darwin.

tiancaiamao commented 2 years ago

Thanks @mndrix Here the mmap is a trick that I want to avoid actual allocation for fixnum number.

If you want to try the code, you'd better go with a released commit. Several recent commit break the functionality.