Improve onSymbol API
This commit is contained in:
parent
a8b08e1867
commit
f7a77b7ab9
6 changed files with 58 additions and 31 deletions
|
|
@ -14,8 +14,8 @@ cAddStdDir()
|
|||
cPlugin:
|
||||
import strutils
|
||||
|
||||
proc onSymbol*(sym: string): string {.exportc, dynlib.} =
|
||||
return sym.strip(chars={'_'})
|
||||
proc onSymbol*(sym: var Symbol): Result {.exportc, dynlib.} =
|
||||
sym.name = sym.name.strip(chars={'_'})
|
||||
|
||||
cImport cSearchPath("math.h")
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ cCompile cSearchPath("test.c")
|
|||
cPlugin:
|
||||
import strutils
|
||||
|
||||
proc onSymbol*(sym: string): string {.exportc, dynlib.} =
|
||||
return sym.strip(chars={'_'})
|
||||
proc onSymbol*(sym: var Symbol): Result {.exportc, dynlib.} =
|
||||
sym.name = sym.name.strip(chars={'_'})
|
||||
|
||||
cImport cSearchPath "test.h"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue