diff options
| author | GoaLitiuM <goalitium@kapsi.fi> | 2018-08-20 18:21:34 +0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-08-20 22:17:43 +0300 |
| commit | 6e00ab6236e9d65376ac8c603e1321a6a0af6b57 (patch) | |
| tree | ad40a7283fad394e3c17d876a0a21af754e7426a /test cases/d/10 d cpp/cppmain.cpp | |
| parent | e0120b4586225a41e08af936bf3e04f4db78ac6f (diff) | |
| download | meson-6e00ab6236e9d65376ac8c603e1321a6a0af6b57.tar.gz | |
Improve D mixed language test case
Diffstat (limited to 'test cases/d/10 d cpp/cppmain.cpp')
| -rw-r--r-- | test cases/d/10 d cpp/cppmain.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test cases/d/10 d cpp/cppmain.cpp b/test cases/d/10 d cpp/cppmain.cpp index aeddf56e8..ff90e3f41 100644 --- a/test cases/d/10 d cpp/cppmain.cpp +++ b/test cases/d/10 d cpp/cppmain.cpp @@ -1,6 +1,18 @@ +extern "C" int rt_init(); +extern "C" int rt_term(); extern void print_hello(int i); int main(int, char**) { + // initialize D runtime + if (!rt_init()) + return 1; + print_hello(1); + + // terminate D runtime, each initialize call + // must be paired with a terminate call. + if (!rt_term()) + return 1; + return 0; } |
