mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
pref,os,sokol,cgen: ease compilation of 2048 with -os wasm32_emscripten
(#15820)
This commit is contained in:
@@ -901,7 +901,9 @@ pub fn fork() int {
|
||||
pub fn wait() int {
|
||||
mut pid := -1
|
||||
$if !windows {
|
||||
pid = C.wait(0)
|
||||
$if !emscripten ? {
|
||||
pid = C.wait(0)
|
||||
}
|
||||
}
|
||||
$if windows {
|
||||
panic('os.wait not supported in windows') // TODO
|
||||
|
@@ -8,7 +8,7 @@ import strings
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/types.h>
|
||||
#include <utime.h>
|
||||
$if !solaris && !haiku {
|
||||
$if !solaris && !haiku && !emscripten ? {
|
||||
#include <sys/ptrace.h>
|
||||
}
|
||||
|
||||
|
@@ -75,7 +75,10 @@ fn (mut p Process) unix_kill_pgroup() {
|
||||
|
||||
fn (mut p Process) unix_wait() {
|
||||
cstatus := 0
|
||||
ret := C.waitpid(p.pid, &cstatus, 0)
|
||||
mut ret := -1
|
||||
$if !emscripten ? {
|
||||
ret = C.waitpid(p.pid, &cstatus, 0)
|
||||
}
|
||||
if ret == -1 {
|
||||
p.err = posix_get_error_msg(C.errno)
|
||||
return
|
||||
@@ -92,7 +95,10 @@ fn (mut p Process) unix_wait() {
|
||||
|
||||
fn (mut p Process) unix_is_alive() bool {
|
||||
cstatus := 0
|
||||
ret := C.waitpid(p.pid, &cstatus, C.WNOHANG)
|
||||
mut ret := -1
|
||||
$if !emscripten ? {
|
||||
ret = C.waitpid(p.pid, &cstatus, C.WNOHANG)
|
||||
}
|
||||
if ret == -1 {
|
||||
p.err = posix_get_error_msg(C.errno)
|
||||
return false
|
||||
|
Reference in New Issue
Block a user