mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-03 20:44:46 +00:00
implements https://github.com/nim-lang/RFCs/issues/260 (#15505)
* implements https://github.com/nim-lang/RFCs/issues/260 * added a test case
This commit is contained in:
4
tests/pragmas/cfunction.c
Normal file
4
tests/pragmas/cfunction.c
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
int cfunction(void) {
|
||||
return NUMBER_HERE;
|
||||
}
|
||||
9
tests/pragmas/tcompile_pragma.nim
Normal file
9
tests/pragmas/tcompile_pragma.nim
Normal file
@@ -0,0 +1,9 @@
|
||||
discard """
|
||||
output: '''34'''
|
||||
"""
|
||||
|
||||
{.compile("cfunction.c", "-DNUMBER_HERE=34").}
|
||||
|
||||
proc cfunction(): cint {.importc.}
|
||||
|
||||
echo cfunction()
|
||||
Reference in New Issue
Block a user