parent
21bd2d4112
commit
e2430cf40c
3 changed files with 12 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ proc execCmd(cmd:string)=
|
||||||
|
|
||||||
task test, "Test":
|
task test, "Test":
|
||||||
execCmd "nim c -r tests/tnimterop_c.nim"
|
execCmd "nim c -r tests/tnimterop_c.nim"
|
||||||
|
execCmd "nim cpp -r tests/tnimterop_c.nim"
|
||||||
execCmd "nim cpp -r tests/tnimterop_cpp.nim"
|
execCmd "nim cpp -r tests/tnimterop_cpp.nim"
|
||||||
# when defined(windows):
|
# when defined(windows):
|
||||||
# execCmd "nim c -r tests/tmath.nim"
|
# execCmd "nim c -r tests/tmath.nim"
|
||||||
|
|
|
||||||
|
|
@ -95,10 +95,11 @@ proc getCurrentHeader*(fullpath: string): string =
|
||||||
|
|
||||||
proc getGccPaths*(mode = "c"): string =
|
proc getGccPaths*(mode = "c"): string =
|
||||||
var
|
var
|
||||||
|
ret = 0
|
||||||
nul = when defined(Windows): "nul" else: "/dev/null"
|
nul = when defined(Windows): "nul" else: "/dev/null"
|
||||||
mmode = if mode == "cpp": "c++" else: mode
|
mmode = if mode == "cpp": "c++" else: mode
|
||||||
|
|
||||||
return staticExec("gcc -Wp,-v -x" & mmode & " " & nul)
|
(result, ret) = gorgeEx("gcc -Wp,-v -x" & mmode & " " & nul)
|
||||||
|
|
||||||
proc getPreprocessor*(fullpath: string, mode = "cpp"): string =
|
proc getPreprocessor*(fullpath: string, mode = "cpp"): string =
|
||||||
var
|
var
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define TEST_INT 512
|
#define TEST_INT 512
|
||||||
|
|
@ -77,3 +81,7 @@ union UNION1 test_call_param5(float param1);
|
||||||
unsigned char test_call_param6(UNION2 param1);
|
unsigned char test_call_param6(UNION2 param1);
|
||||||
int test_call_param7(union UNION1 param1);
|
int test_call_param7(union UNION1 param1);
|
||||||
float test_call_param8(int *param1);
|
float test_call_param8(int *param1);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Loading…
Add table
Add a link
Reference in a new issue