first steps for FFI support at compile time
This commit is contained in:
parent
3be576222a
commit
7148812524
7 changed files with 420 additions and 49 deletions
|
|
@ -13,6 +13,7 @@ import
|
|||
const
|
||||
hasTinyCBackend* = defined(tinyc)
|
||||
useEffectSystem* = true
|
||||
hasFFI* = defined(useFFI)
|
||||
|
||||
type # please make sure we have under 32 options
|
||||
# (improves code efficiency a lot!)
|
||||
|
|
@ -230,6 +231,17 @@ proc findModule*(modulename: string): string {.inline.} =
|
|||
# returns path to module
|
||||
result = FindFile(AddFileExt(modulename, nimExt))
|
||||
|
||||
proc libCandidates*(s: string, dest: var seq[string]) =
|
||||
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)
|
||||
|
||||
proc binaryStrSearch*(x: openarray[string], y: string): int =
|
||||
var a = 0
|
||||
var b = len(x) - 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue