summary refs log tree commit diff stats
path: root/tools/vccexe
diff options
context:
space:
mode:
authorNeelesh Chandola <neelesh.chandola@outlook.com>2018-12-13 12:40:52 +0530
committerNeelesh Chandola <neelesh.chandola@outlook.com>2018-12-13 12:40:52 +0530
commit9ebe52cdeb483ab90711021f671dc543de371dc0 (patch)
tree23846ec60cc10a29210890f746b7aff8c937db22 /tools/vccexe
parent76c214a2e95787f15a704b395de01261b8e003e3 (diff)
downloadNim-9ebe52cdeb483ab90711021f671dc543de371dc0.tar.gz
Fix vccexe compilation
Diffstat (limited to 'tools/vccexe')
-rw-r--r--tools/vccexe/vccexe.nim18
-rw-r--r--tools/vccexe/vcvarsall.nim4
2 files changed, 11 insertions, 11 deletions
diff --git a/tools/vccexe/vccexe.nim b/tools/vccexe/vccexe.nim
index 2dcff8ce4..e7c3a4d75 100644
--- a/tools/vccexe/vccexe.nim
+++ b/tools/vccexe/vccexe.nim
@@ -2,12 +2,12 @@ import strutils, strtabs, os, osproc, vcvarsall, vccenv
 
 type
   VccVersion* = enum ## VCC compiler backend versions
-    vccUndefined = (0, ""), ## VCC version undefined, resolves to the latest recognizable VCC version
-    vcc90  =  vs90, ## Visual Studio 2008 (Version 9.0)
-    vcc100 = vs100, ## Visual Studio 2010 (Version 10.0)
-    vcc110 = vs110, ## Visual Studio 2012 (Version 11.0)
-    vcc120 = vs120, ## Visual Studio 2013 (Version 12.0)
-    vcc140 = vs140  ## Visual Studio 2015 (Version 14.0)
+    vccUndefined = 0,   ## VCC version undefined, resolves to the latest recognizable VCC version
+    vcc90  = ord(vs90)  ## Visual Studio 2008 (Version 9.0)
+    vcc100 = ord(vs100) ## Visual Studio 2010 (Version 10.0)
+    vcc110 = ord(vs110) ## Visual Studio 2012 (Version 11.0)
+    vcc120 = ord(vs120) ## Visual Studio 2013 (Version 12.0)
+    vcc140 = ord(vs140) ## Visual Studio 2015 (Version 14.0)
 
 proc discoverVccVcVarsAllPath*(version: VccVersion = vccUndefined): string =
   ## Returns the path to the vcvarsall utility of the specified VCC compiler backend.
@@ -101,12 +101,12 @@ command was specified
 when isMainModule:
   var vccversionArg: seq[string] = @[]
   var printPathArg: bool = false
-  var vcvarsallArg: string = nil
-  var commandArg: string = nil
+  var vcvarsallArg: string
+  var commandArg: string
   var noCommandArg: bool = false
   var platformArg: VccArch
   var sdkTypeArg: VccPlatformType
-  var sdkVersionArg: string = nil
+  var sdkVersionArg: string
   var verboseArg: bool = false
 
   var clArgs: seq[TaintedString] = @[]
diff --git a/tools/vccexe/vcvarsall.nim b/tools/vccexe/vcvarsall.nim
index e7a55069c..defcf687f 100644
--- a/tools/vccexe/vcvarsall.nim
+++ b/tools/vccexe/vcvarsall.nim
@@ -34,7 +34,7 @@ type
     vccplatUWP = "uwp", ## Universal Windows Platform (UWP) Application
     vccplatOneCore = "onecore" # Undocumented platform type in the Windows SDK, probably XBox One SDK platform type.
 
-proc vccVarsAll*(path: string, arch: VccArch = vccarchUnspecified, platform_type: VccPlatformType = vccplatEmpty, sdk_version: string = nil, verbose: bool = false): StringTableRef =
+proc vccVarsAll*(path: string, arch: VccArch = vccarchUnspecified, platform_type: VccPlatformType = vccplatEmpty, sdk_version: string = "", verbose: bool = false): StringTableRef =
   ## Returns a string table containing the proper process environment to successfully execute VCC compile commands for the specified SDK version, CPU architecture and platform type.
   ##
   ## path
@@ -50,7 +50,7 @@ proc vccVarsAll*(path: string, arch: VccArch = vccarchUnspecified, platform_type
 
   var vccvarsallpath = path
   # Assume that default executable is in current directory or in PATH
-  if path == nil or path.len < 1:
+  if path == "":
     vccvarsallpath = vcvarsallDefaultPath
   
   var args: seq[string] = @[]