diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2021-02-17 12:24:27 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-17 19:24:27 +0100 |
commit | 98102605d911171d79cf66327dee100cc2c8e05d (patch) | |
tree | ba18d9b4daf4fc41149f2841d958e9a54f412ab1 /lib/pure | |
parent | f49d148a918cf8becec91f7d06f9b72e2bf4c4a2 (diff) | |
download | Nim-98102605d911171d79cf66327dee100cc2c8e05d.tar.gz |
fix the unused warnings on windows (#17073)
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/os.nim | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index a65186410..51ad8b6df 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -41,7 +41,7 @@ ## * `dynlib module <dynlib.html>`_ ## * `streams module <streams.html>`_ -include "system/inclrtl" +include system/inclrtl import std/private/since import std/[strutils, pathnorm] @@ -1095,14 +1095,16 @@ when defined(windows) or defined(posix) or defined(nintendoswitch): result.add quoteShell(args[i]) when not weirdTarget: - proc c_rename(oldname, newname: cstring): cint {. - importc: "rename", header: "<stdio.h>".} proc c_system(cmd: cstring): cint {. importc: "system", header: "<stdlib.h>".} - proc c_strlen(a: cstring): cint {. - importc: "strlen", header: "<string.h>", noSideEffect.} - proc c_free(p: pointer) {. - importc: "free", header: "<stdlib.h>".} + + when not defined(windows): + proc c_rename(oldname, newname: cstring): cint {. + importc: "rename", header: "<stdio.h>".} + proc c_strlen(a: cstring): cint {. + importc: "strlen", header: "<string.h>", noSideEffect.} + proc c_free(p: pointer) {. + importc: "free", header: "<stdlib.h>".} when defined(windows) and not weirdTarget: @@ -1193,8 +1195,11 @@ proc symlinkExists*(link: string): bool {.rtl, extern: "nos$1", var res: Stat return lstat(link, res) >= 0'i32 and S_ISLNK(res.st_mode) + +when not defined(windows): + const maxSymlinkLen = 1024 + const - maxSymlinkLen = 1024 ExeExts* = ## Platform specific file extension for executables. ## On Windows ``["exe", "cmd", "bat"]``, on Posix ``[""]``. when defined(windows): ["exe", "cmd", "bat"] else: [""] |