posix: add full Haiku support (#13931)

* posix: add full Haiku support

This commit provides a posix_haiku derived from posix_other, with types
following Haiku's definition. This fixes cases where the compiler
generates type check for the wrong types (ie. checks where generated for
an int-derived type but it's actually implemented as an uint instead).

* tools/kochdocs: welcome posix_haiku to the blacklist
This commit is contained in:
alaviss 2020-04-09 13:56:08 +00:00 • committed by GitHub
commit cc3f5d21b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 609 additions and 2 deletions

View file

@ -88,7 +88,7 @@ const
type Sighandler = proc (a: cint) {.noconv.}
const StatHasNanoseconds* = defined(linux) or defined(freebsd) or
defined(osx) or defined(openbsd) or defined(dragonfly) ## \
defined(osx) or defined(openbsd) or defined(dragonfly) or defined(haiku) ## \
## Boolean flag that indicates if the system supports nanosecond time
## resolution in the fields of ``Stat``. Note that the nanosecond based fields
## (``Stat.st_atim``, ``Stat.st_mtim`` and ``Stat.st_ctim``) can be accessed
@ -105,6 +105,8 @@ elif (defined(macos) or defined(macosx) or defined(bsd)) and defined(cpu64):
include posix_macos_amd64
elif defined(nintendoswitch):
include posix_nintendoswitch
elif defined(haiku):
include posix_haiku
else:
include posix_other
@ -636,7 +638,8 @@ proc posix_madvise*(a1: pointer, a2: int, a3: cint): cint {.
importc, header: "<sys/mman.h>".}
proc posix_mem_offset*(a1: pointer, a2: int, a3: var Off,
a4: var int, a5: var cint): cint {.importc, header: "<sys/mman.h>".}
when not (defined(linux) and defined(amd64)) and not defined(nintendoswitch):
when not (defined(linux) and defined(amd64)) and not defined(nintendoswitch) and
not defined(haiku):
proc posix_typed_mem_get_info*(a1: cint,
a2: var Posix_typed_mem_info): cint {.importc, header: "<sys/mman.h>".}
proc posix_typed_mem_open*(a1: cstring, a2, a3: cint): cint {.