//This is a complete example of a compilation error
//macros ZINITIALIZE(init) compile _Pragma("startup" "init")
#include <stdio.h>
#include <stdlib.h>
#ifdef __POCC__
#define WIN32_DEFAULT_LIBS
#define __STDC_WANT_LIB_EXT1__ 1
#define ZINITIALIZE(NameInit) _ZINITIALIZE1(NameInit)
#define _ZINITIALIZE1(NameInit) _ZINITIALIZE2(NameInit)
#define _ZINITIALIZE2(NameInit) _Pragma("startup " #NameInit)
#elif defined(__MINGW64__)
#define ZINITIALIZE(NameInit) void __cdecl NameInit(void) __attribute__((constructor))
#endif
void init(void);
int main(int argc, char *argv[]) {
return 0;
}
ZINITIALIZE(init);
//_Pragma("startup" "init");
void init(void) {
printf("Init!\n");
}