Fixed test suite on windows

This commit is contained in:
Dominik Picheta 2011-11-19 22:44:02 +00:00
commit 9e06495261
3 changed files with 8 additions and 7 deletions

View file

@ -868,7 +868,8 @@ iterator walkDirRec*(dir: string, filter={pcFile, pcDir}): string =
proc rawRemoveDir(dir: string) =
when defined(windows):
if RemoveDirectoryA(dir) == 0'i32 and GetLastError() != 3'i32: OSError()
if RemoveDirectoryA(dir) != 0'i32 and GetLastError() != 3'i32 and
GetLastError() != 18'i32: OSError()
else:
if rmdir(dir) != 0'i32 and errno != ENOENT: OSError()

View file

@ -131,7 +131,7 @@ proc countProcessors*(): int {.rtl, extern: "nosp$1".} =
## Returns 0 if it cannot be detected.
when defined(windows):
var x = getenv("NUMBER_OF_PROCESSORS")
if x.len > 0: result = parseInt(x)
if x.len > 0: result = parseInt(x.string)
elif defined(macosx) or defined(bsd):
var
mib: array[0..3, cint]