Add specific lib code for Nintendo Switch

This commit is contained in:
Joey Yakimowich-Payne 2018-06-19 17:11:22 +09:00
commit 8a0bff973f
7 changed files with 40 additions and 8 deletions

View file

@ -819,7 +819,8 @@ iterator walkDir*(dir: string; relative=false): tuple[kind: PathComponent, path:
y = dir / y
var k = pcFile
when defined(linux) or defined(macosx) or defined(bsd) or defined(genode):
when defined(linux) or defined(macosx) or
defined(bsd) or defined(genode) or defined(nintendoswitch):
if x.d_type != DT_UNKNOWN:
if x.d_type == DT_DIR: k = pcDir
if x.d_type == DT_LNK:
@ -1285,7 +1286,7 @@ elif defined(windows):
elif not defined(createNimRtl) and
not(defined(posix) and appType == "lib") and
not defined(genode):
not defined(genode) and not defined(nintendoswitch):
# On Posix, there is no portable way to get the command line from a DLL.
var
cmdCount {.importc: "cmdCount".}: cint
@ -1439,7 +1440,7 @@ proc getAppFilename*(): string {.rtl, extern: "nos$1", tags: [ReadIOEffect].} =
result = getApplAux("/proc/self/exe")
elif defined(solaris):
result = getApplAux("/proc/" & $getpid() & "/path/a.out")
elif defined(genode):
elif defined(genode) or defined(nintendoswitch):
raiseOSError(OSErrorCode(-1), "POSIX command line not supported")
elif defined(freebsd) or defined(dragonfly):
result = getApplFreebsd()

View file

@ -312,6 +312,8 @@ else:
include ioselects/ioselectors_poll # need to replace it with event ports
elif defined(genode):
include ioselects/ioselectors_select # TODO: use the native VFS layer
elif defined(nintendoswitch):
include ioselects/ioselectors_select
else:
include ioselects/ioselectors_poll