summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2021-02-17 12:24:27 -0600
committerGitHub <noreply@github.com>2021-02-17 19:24:27 +0100
commit98102605d911171d79cf66327dee100cc2c8e05d (patch)
treeba18d9b4daf4fc41149f2841d958e9a54f412ab1 /lib
parentf49d148a918cf8becec91f7d06f9b72e2bf4c4a2 (diff)
downloadNim-98102605d911171d79cf66327dee100cc2c8e05d.tar.gz
fix the unused warnings on windows (#17073)
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/os.nim21
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: [""]
acf79a90ca25560e5a'>^
0ae23bf83 ^

7c08d14cf ^

32b4192b3 ^









32b4192b3 ^

7c08d14cf ^



32b4192b3 ^

e2d38a57e ^

32b4192b3 ^

e2d38a57e ^

32b4192b3 ^















e0746e7b1 ^

faed98d21 ^

32b4192b3 ^

040c57f0a ^
0ae23bf83 ^

040c57f0a ^
ff4a69b62 ^
040c57f0a ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190