END_OF_MAIN(3alleg4)

πŸ’– NAME πŸ’–

END_OF_MAIN β€” the macro you put after your main() function, bestie. It's part of the Allegro game programming library. ✨


🌸 SYNOPSIS 🌸

#include <allegro.h>

Macro END_OF_MAIN()

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so listen. For cross-platform compatibility β€” like, the whole reason this thing exists β€” you have to put this macro at the very, very end of your main function. Like, after the closing brace. Not inside. After. πŸ’…

This macro does some lowkey magic'</purple> to mangle your main` procedure on the platforms that need it, and the ones that need it are: Windows, some flavours of UNIX, and MacOS X. They're the ones being extra about it. πŸ™ˆ

But on the other platforms? It literally compiles to nothing. Zero. Zilch. So you do not have to #ifdef around it β€” no cap, just drop it in and forget about it. That's the whole vibe. 🫢

Example, because a visual helps:

int main(void)
{
   allegro_init();
   /* more stuff goes here */
   ...
   return 0;
}
END_OF_MAIN()

See how it's just chilling after the }? That's the assignment. Main character macro behavior honestly. πŸ‘‘


⭐ SEE ALSO ⭐

Allegro β€” the whole library, the moment, the icon. 🌈


okay that's the whole page, you're literally done πŸ’œ huge thanks to the Allegro girlies for this one β€” this is Allegro version 4.4.3 and the page is END_OF_MAIN(3alleg4), slay, go write some cross-platform game code bestie πŸŽ€βœ¨