More fixes for Haiku (#13774)
* osproc: move fork-based code path under the when conditional * osproc: avoid using the environ global on Haiku * osenv: import environ from stdlib.h on Haiku Haiku's environ is declared in `<stdlib.h>` by default, differing from POSIX and/or Linux. Import it from there to avoid collision with anyone importing `<stdlib.h>` from Nim.
This commit is contained in:
parent
142c59fc37
commit
0eaacbc2c4
2 changed files with 49 additions and 46 deletions
|
|
@ -81,6 +81,8 @@ else:
|
|||
# at runtime.
|
||||
proc NSGetEnviron(): ptr cstringArray {.
|
||||
importc: "_NSGetEnviron", header: "<crt_externs.h>".}
|
||||
elif defined(haiku):
|
||||
var gEnv {.importc: "environ", header: "<stdlib.h>".}: cstringArray
|
||||
else:
|
||||
var gEnv {.importc: "environ".}: cstringArray
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue