Prevent Exported C procedure collisions

Prevents collisions between those C externalized procedures in parseopt and parseopt2.
This commit is contained in:
Varriount 2015-11-11 15:18:13 -05:00
commit 3832ea0785

View file

@ -70,7 +70,7 @@ when not defined(createNimRtl):
## Initializes option parser from current command line arguments. ## Initializes option parser from current command line arguments.
return initOptParser(commandLineParams()) return initOptParser(commandLineParams())
proc next*(p: var OptParser) {.rtl, extern: "npo$1".} proc next*(p: var OptParser) {.rtl, extern: "npo2$1".}
proc nextOption(p: var OptParser, token: string, allowEmpty: bool) = proc nextOption(p: var OptParser, token: string, allowEmpty: bool) =
for splitchar in [':', '=']: for splitchar in [':', '=']:
@ -113,7 +113,7 @@ proc next(p: var OptParser) =
p.key = token p.key = token
p.val = "" p.val = ""
proc cmdLineRest*(p: OptParser): TaintedString {.rtl, extern: "npo$1", deprecated.} = proc cmdLineRest*(p: OptParser): TaintedString {.rtl, extern: "npo2$1", deprecated.} =
## Returns part of command line string that has not been parsed yet. ## Returns part of command line string that has not been parsed yet.
## Do not use - does not correctly handle whitespace. ## Do not use - does not correctly handle whitespace.
return p.cmd[p.pos..p.cmd.len-1].join(" ") return p.cmd[p.pos..p.cmd.len-1].join(" ")