Created
January 28, 2020 23:15
-
-
Save astatide/65f3867a50bebe40348422837c489383 to your computer and use it in GitHub Desktop.
Chapel extern reproducer
This file contains hidden or 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
| module C { | |
| extern { | |
| #include "externtest.h" | |
| static int foo(int x) { return x + 1; } | |
| struct mystruct obj; | |
| } | |
| proc tryMe() { | |
| writeln(obj.a); | |
| return foo(3); | |
| } | |
| } | |
| writeln(C.tryMe()); | |
| //writeln(C.foo(3)); | |
| writeln(C.obj.a); |
This file contains hidden or 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
| struct mystruct | |
| { | |
| int a; | |
| int b; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment