mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Addin @varcast
This commit is contained in:
@@ -10,6 +10,12 @@ macro scope(&variable; @body) @autoimport
|
||||
@body();
|
||||
}
|
||||
|
||||
macro varcast(variant v, $Type) @autoimport
|
||||
{
|
||||
if (v.type != $Type.typeid) return null;
|
||||
return ($Type*)v.ptr;
|
||||
}
|
||||
|
||||
extern fn void printf(char*, ...);
|
||||
|
||||
struct CallstackElement
|
||||
|
||||
Reference in New Issue
Block a user