diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2018-12-27 23:38:02 -0600 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2018-12-27 23:38:02 -0600 |
| commit | e2430cf40c95d33c2987c21c76557d444bca0d27 (patch) | |
| tree | 658656c2a9343016790357480c8b85ec59912e18 | |
| parent | 21bd2d4112e5bf40d3fe52435cc15ccd5d4ad71a (diff) | |
| download | nimterop-e2430cf40c95d33c2987c21c76557d444bca0d27.tar.gz nimterop-e2430cf40c95d33c2987c21c76557d444bca0d27.zip | |
Fix #15, fix #20
| -rw-r--r-- | nimterop.nimble | 1 | ||||
| -rw-r--r-- | nimterop/getters.nim | 3 | ||||
| -rw-r--r-- | tests/include/test.h | 10 |
3 files changed, 12 insertions, 2 deletions
diff --git a/nimterop.nimble b/nimterop.nimble index b1ee584..c3c87a7 100644 --- a/nimterop.nimble +++ b/nimterop.nimble @@ -18,6 +18,7 @@ proc execCmd(cmd:string)= task test, "Test": execCmd "nim c -r tests/tnimterop_c.nim" + execCmd "nim cpp -r tests/tnimterop_c.nim" execCmd "nim cpp -r tests/tnimterop_cpp.nim" # when defined(windows): # execCmd "nim c -r tests/tmath.nim" diff --git a/nimterop/getters.nim b/nimterop/getters.nim index df1c3d7..1ff4d49 100644 --- a/nimterop/getters.nim +++ b/nimterop/getters.nim @@ -95,10 +95,11 @@ proc getCurrentHeader*(fullpath: string): string = proc getGccPaths*(mode = "c"): string = var + ret = 0 nul = when defined(Windows): "nul" else: "/dev/null" 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 = var diff --git a/tests/include/test.h b/tests/include/test.h index 29181c5..6a3d9a4 100644 --- a/tests/include/test.h +++ b/tests/include/test.h @@ -1,3 +1,7 @@ +#ifdef __cplusplus +extern "C" { +#endif + #include <stdint.h> #define TEST_INT 512 @@ -76,4 +80,8 @@ ENUM2 test_call_param4(enum ENUM param1); union UNION1 test_call_param5(float param1); unsigned char test_call_param6(UNION2 param1); int test_call_param7(union UNION1 param1); -float test_call_param8(int *param1);
\ No newline at end of file +float test_call_param8(int *param1); + +#ifdef __cplusplus +} +#endif
\ No newline at end of file |
