11 lines
335 B
C
11 lines
335 B
C
#include <stdio.h>
|
|
|
|
// Before attribute
|
|
#define BEFORE_ATR __attribute__((constructor))
|
|
// After attribute
|
|
#define AFTER_ATR __attribute__((destructor))
|
|
|
|
void BEFORE_ATR beforeFunc() { printf("Executed before main\n"); }
|
|
void AFTER_ATR afterFunc() { printf("Executed after main\n"); }
|
|
|
|
int main(void) { printf("Executed in main\n"); }
|