-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from timotheecour/pr_tnimterop_cpp
misc changes
- Loading branch information
Showing
7 changed files
with
78 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "test2.hpp" | ||
|
||
int test_call_int() { | ||
return 5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <stdint.h> | ||
|
||
#define TEST_INT 512 | ||
#define TEST_FLOAT 5.12 | ||
#define TEST_HEX 0x512 | ||
|
||
int test_call_int(); | ||
|
||
struct Foo{ | ||
int bar; | ||
}; | ||
|
||
class Foo1{ | ||
int bar1; | ||
}; | ||
|
||
template<typename T> | ||
struct Foo2{ | ||
int bar2; | ||
}; | ||
|
||
typedef Foo2<int> Foo2_int; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import nimterop/cimport | ||
import unittest | ||
|
||
cDebug() | ||
|
||
cIncludeDir "$projpath/include" | ||
cAddSearchDir "$projpath/include" | ||
cCompile cSearchPath "test2.cpp" | ||
cImport cSearchPath "test2.hpp" | ||
|
||
check TEST_INT == 512 | ||
check TEST_FLOAT == 5.12 | ||
check TEST_HEX == 0x512 | ||
check test_call_int() == 5 | ||
|
||
var foo: Foo | ||
check foo.bar == 0 |