From b233ce0f2328971663269a90e8b7cabd67326ee7 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Wed, 27 Jun 2018 18:36:13 +0900 Subject: [PATCH] Fix travis errors with undefined consts and add correct wait.h procs --- lib/posix/posix_nintendoswitch.nim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/posix/posix_nintendoswitch.nim b/lib/posix/posix_nintendoswitch.nim index 7e5d6282b..892ea3370 100644 --- a/lib/posix/posix_nintendoswitch.nim +++ b/lib/posix/posix_nintendoswitch.nim @@ -9,6 +9,10 @@ # To be included from posix.nim! +const + hasSpawnH = true + hasAioH = false + type DIR* {.importc: "DIR", header: "", incompleteStruct.} = object @@ -494,10 +498,9 @@ include posix_nintendoswitch_consts const POSIX_SPAWN_USEVFORK* = cint(0x40) # needs _GNU_SOURCE! # -proc WEXITSTATUS*(s: cint): cint = (s and 0xff00) shr 8 +proc WEXITSTATUS*(s: cint): cint = (s shr 8) and 0xff +proc WIFEXITED*(s:cint) : bool = (s and 0xff) == 0 proc WTERMSIG*(s:cint): cint = s and 0x7f proc WSTOPSIG*(s:cint): cint = WEXITSTATUS(s) -proc WIFEXITED*(s:cint) : bool = WTERMSIG(s) == 0 -proc WIFSIGNALED*(s:cint) : bool = (cast[int8]((s and 0x7f) + 1) shr 1) > 0 +proc WIFSIGNALED*(s:cint) : bool = ((s and 0x7f) > 0) and ((s and 0x7f) < 0x7f) proc WIFSTOPPED*(s:cint) : bool = (s and 0xff) == 0x7f -proc WIFCONTINUED*(s:cint) : bool = s == W_CONTINUED