Skip to content

Instantly share code, notes, and snippets.

@astatide
Created January 28, 2020 23:15
Show Gist options
  • Select an option

  • Save astatide/65f3867a50bebe40348422837c489383 to your computer and use it in GitHub Desktop.

Select an option

Save astatide/65f3867a50bebe40348422837c489383 to your computer and use it in GitHub Desktop.
Chapel extern reproducer
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);
struct mystruct
{
int a;
int b;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment