From 65c2e7f1ccc6cdb5daec343c7e32b4a9dc463ae4 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 12 Apr 2022 15:23:53 -0700 Subject: Support `[DllImport]` (#2181) * Support `[DllImport]` * Fix. * Fix. * Fix array type emit in cpp. * Fix. * Fix. * Fix Co-authored-by: Yong He --- examples/heterogeneous-hello-world/main.slang | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples') diff --git a/examples/heterogeneous-hello-world/main.slang b/examples/heterogeneous-hello-world/main.slang index 08b4b7f39..90f39fff7 100644 --- a/examples/heterogeneous-hello-world/main.slang +++ b/examples/heterogeneous-hello-world/main.slang @@ -3,8 +3,12 @@ __target_intrinsic(cpp, "printf(\"%s\", ($0).getBuffer())") public void writeln(String text); +[DllImport("User32")] +int MessageBoxA(Ptr hwnd, String text, String caption, uint flags); + public __extern_cpp int main() { writeln("hello world"); + MessageBoxA(nullptr, "hello world!", "example", 0); return 0; } \ No newline at end of file -- cgit v1.2.3