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 --- source/slang/core.meta.slang | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/slang/core.meta.slang') diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang index c8e05d769..c3e41b8fc 100644 --- a/source/slang/core.meta.slang +++ b/source/slang/core.meta.slang @@ -342,11 +342,18 @@ ${{{{ // Declare built-in pointer type // (eventually we can have the traditional syntax sugar for this) }}}} + +__magic_type(NullPtrType) +struct NullPtr +{ +}; + __generic __magic_type(PtrType) __intrinsic_type($(kIROp_PtrType)) struct Ptr -{}; +{ +}; __generic __magic_type(OutType) @@ -2164,6 +2171,10 @@ attribute_syntax [__extern] : ExternAttribute; __attributeTarget(FunctionDeclBase) attribute_syntax [__unsafeForceInlineEarly] : UnsafeForceInlineEarlyAttribute; +__attributeTarget(FuncDecl) +attribute_syntax [DllImport(modulePath: String)] : DllImportAttribute; + + // Inheritance Control __attributeTarget(AggTypeDecl) attribute_syntax [sealed] : SealedAttribute; @@ -2185,3 +2196,4 @@ attribute_syntax [noinline] : NoInlineAttribute; __attributeTarget(StructDecl) attribute_syntax [payload] : PayloadAttribute; + -- cgit v1.2.3