mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 18:02:02 +00:00
Add @(init) attribute for procedures, allowing for procedures to be called at startup
These procedures will be called after global variables have been initialized as normal
This commit is contained in:
@@ -722,6 +722,9 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) {
|
||||
if (ac.test) {
|
||||
e->flags |= EntityFlag_Test;
|
||||
}
|
||||
if (ac.init) {
|
||||
e->flags |= EntityFlag_Init;
|
||||
}
|
||||
if (ac.set_cold) {
|
||||
e->flags |= EntityFlag_Cold;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user