Add inline comments to constructor and destructor attributes

This commit is contained in:
8dcc 2023-07-21 13:59:38 +02:00
parent 4c5fbcd677
commit 01312cb4b6
1 changed files with 4 additions and 7 deletions

View File

@ -10,12 +10,8 @@
static bool loaded = false; static bool loaded = false;
/* __attribute__((constructor)) /* Entry point when injected */
* We need: void load(void) {
* __attribute__((constructor))
* To indicate that this function will be the entry point once injected.
*/
__attribute__((constructor)) void load(void) {
printf("hl-cheat injected!\n"); printf("hl-cheat injected!\n");
/* Initialize globals/interfaces */ /* Initialize globals/interfaces */
@ -44,7 +40,8 @@ __attribute__((constructor)) void load(void) {
loaded = true; loaded = true;
} }
__attribute__((destructor)) void unload() { __attribute__((destructor)) /* Entry point when unloaded */
void unload() {
if (loaded) { if (loaded) {
/* TODO: Remove our cvars */ /* TODO: Remove our cvars */