aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-10-03 11:53:32 +0100
committergingerBill <bill@gingerbill.org>2021-10-03 11:53:32 +0100
commit2bdae52fed2ac0845ebb24348f3834dbc63f6d34 (patch)
tree02b05813607d403681bbf41443eafcaa510e430b /src/check_decl.cpp
parentb3a66b3950283853ce99a7da71ad8f1850fba0d8 (diff)
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
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index d9229ee9b..0591eca4d 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -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;
}