diff options
author | Araq <rumpf_a@web.de> | 2017-01-07 02:43:31 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-01-07 02:43:31 +0100 |
commit | 5c08ca7ed2a50b7d1f9ecdb0675e8bba76337054 (patch) | |
tree | 3adb8d24ace30b207a831d18dc65e53411ba37ba /compiler/cgen.nim | |
parent | 9d488261dfafd90870f46e5b361dc55df301ff16 (diff) | |
download | Nim-5c08ca7ed2a50b7d1f9ecdb0675e8bba76337054.tar.gz |
make Nim compiler compile with 0.15.2
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r-- | compiler/cgen.nim | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim index eca3c6db2..ac0fa3598 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -16,11 +16,24 @@ import condsyms, rodutils, renderer, idgen, cgendata, ccgmerge, semfold, aliases, lowerings, semparallel, tables -from modulegraphs import ModuleGraph -from dynlib import libCandidates - import strutils except `%` # collides with ropes.`%` +from modulegraphs import ModuleGraph +import dynlib + +when not declared(dynlib.libCandidates): + proc libCandidates(s: string, dest: var seq[string]) = + ## given a library name pattern `s` write possible library names to `dest`. + var le = strutils.find(s, '(') + var ri = strutils.find(s, ')', le+1) + if le >= 0 and ri > le: + var prefix = substr(s, 0, le - 1) + var suffix = substr(s, ri + 1) + for middle in split(substr(s, le + 1, ri - 1), '|'): + libCandidates(prefix & middle & suffix, dest) + else: + add(dest, s) + when options.hasTinyCBackend: import tccgen |