osproc compiles again for haiku

This commit is contained in:
Araq 2014-03-10 17:32:50 +01:00
commit 121553d1a6
3 changed files with 96 additions and 42 deletions

View file

@ -606,6 +606,7 @@ elif not defined(useNimRtl):
optionPoParentStreams: bool optionPoParentStreams: bool
optionPoStdErrToStdOut: bool optionPoStdErrToStdOut: bool
when not defined(useFork):
proc startProcessAuxSpawn(data: TStartProcessData): TPid {.tags: [FExecIO, FReadEnv].} proc startProcessAuxSpawn(data: TStartProcessData): TPid {.tags: [FExecIO, FReadEnv].}
proc startProcessAuxFork(data: TStartProcessData): TPid {.tags: [FExecIO, FReadEnv].} proc startProcessAuxFork(data: TStartProcessData): TPid {.tags: [FExecIO, FReadEnv].}
{.push stacktrace: off, profiler: off.} {.push stacktrace: off, profiler: off.}
@ -664,7 +665,8 @@ elif not defined(useNimRtl):
data.workingDir = workingDir data.workingDir = workingDir
when defined(posix_spawn) and not defined(useFork) and not defined(useClone) and not defined(linux): when defined(posix_spawn) and not defined(useFork) and
not defined(useClone) and not defined(linux):
pid = startProcessAuxSpawn(data) pid = startProcessAuxSpawn(data)
else: else:
pid = startProcessAuxFork(data) pid = startProcessAuxFork(data)
@ -694,6 +696,7 @@ elif not defined(useNimRtl):
discard close(pStdin[readIdx]) discard close(pStdin[readIdx])
discard close(pStdout[writeIdx]) discard close(pStdout[writeIdx])
when not defined(useFork):
proc startProcessAuxSpawn(data: TStartProcessData): TPid = proc startProcessAuxSpawn(data: TStartProcessData): TPid =
var attr: Tposix_spawnattr var attr: Tposix_spawnattr
var fops: Tposix_spawn_file_actions var fops: Tposix_spawn_file_actions

View file

@ -0,0 +1,52 @@
#! strongSpaces
discard """
output: '''35
77
(Field0: 1, Field1: 2, Field2: 2)
ha
true
tester args
all
all args
'''
"""
echo 2+5 * 5
let foo = 77
echo $foo
echo (1, 2, 2)
template `&`(a, b: int): expr = a and b
template `|`(a, b: int): expr = a - b
template `++`(a, b: int): expr = a + b == 8009
when true:
let b = 66
let c = 90
let bar = 8000
if foo+4 * 4 == 8 and b&c | 9 ++
bar:
echo "ho"
else:
echo "ha"
let booA = foo+4 * 4 - b&c | 9 +
bar
# is parsed as
let booB = ((foo+4)*4) - ((b&c) | 9) + bar
echo booA == booB
template `|`(a, b): expr = (if a.len > 0: a else: b)
const
tester = "tester"
args = "args"
echo tester & " " & args|"all"
echo "all" | tester & " " & args
echo "all"|tester & " " & args

View file

@ -1,7 +1,6 @@
version 0.9.4 version 0.9.4
============= =============
- make testament produce full JSON information
- fix gensym capture bug - fix gensym capture bug
- vm - vm
- at least try to get the basic type zoo ops right - at least try to get the basic type zoo ops right