From 01312cb4b6c6e2ff565fda30131117216bbd0eeb Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Fri, 21 Jul 2023 13:59:38 +0200 Subject: [PATCH] Add inline comments to constructor and destructor attributes --- src/main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index dd9fa38..e0b2366 100644 --- a/src/main.c +++ b/src/main.c @@ -10,12 +10,8 @@ static bool loaded = false; -/* - * We need: - * __attribute__((constructor)) - * To indicate that this function will be the entry point once injected. - */ -__attribute__((constructor)) void load(void) { +__attribute__((constructor)) /* Entry point when injected */ +void load(void) { printf("hl-cheat injected!\n"); /* Initialize globals/interfaces */ @@ -44,7 +40,8 @@ __attribute__((constructor)) void load(void) { loaded = true; } -__attribute__((destructor)) void unload() { +__attribute__((destructor)) /* Entry point when unloaded */ +void unload() { if (loaded) { /* TODO: Remove our cvars */