I suggest to see how this is done in Allegro:
int main(void)
{
allegro_init();
/* more stuff goes here */
...
return 0;
}
END_OF_MAIN()
END_OF_MAIN is a special macro which is different for different
platforms. See Allegro's headers for more info.