Improve onSymbol API

This commit is contained in:
Ganesh Viswanathan 2019-01-27 11:37:33 -06:00 • committed by genotrance
commit f7a77b7ab9
6 changed files with 58 additions and 31 deletions

View file

@ -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")

View file

@ -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"