@@ -38,10 +38,16 @@ #if defined(OF_AMIGAOS4) # include #elif defined(OF_MORPHOS) # include #endif + +#ifdef OF_NINTENDO_SWITCH +# define id nx_id +# import +# undef nx_id +#endif #import "OFSystemInfo.h" #import "OFApplication.h" #import "OFArray.h" #import "OFDictionary.h" @@ -233,10 +239,21 @@ operatingSystemVersion = [[OFString alloc] initWithCString: utsname.release encoding: [OFLocale encoding]]; #endif } + +#ifdef OF_NINTENDO_SWITCH +static OFString *tmpFSPath = nil; + +static void +mountTmpFS(void) +{ + if (R_SUCCEEDED(fsdevMountTemporaryStorage("tmpfs"))) + tmpFSPath = @"tmpfs:/"; +} +#endif #if defined(OF_X86_64) || defined(OF_X86) static OF_INLINE struct X86Regs OF_CONST_FUNC x86CPUID(uint32_t eax, uint32_t ecx) { @@ -566,10 +583,15 @@ return @"T:"; # elif defined(OF_MSDOS) return [[OFApplication environment] objectForKey: @"TEMP"]; # elif defined(OF_MINT) return @"u:\\tmp"; +# elif defined(OF_NINTENDO_SWITCH) + static OFOnceControl onceControl = OFOnceControlInitValue; + OFOnce(&onceControl, mountTmpFS); + + return tmpFSPath; # else OFString *path = [[OFApplication environment] objectForKey: @"XDG_RUNTIME_DIR"]; if (path != nil)