[AD] Proposed END_OF_MAIN documentation.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.136
diff -u -r1.136 allegro._tx
--- docs/src/allegro._tx	22 Mar 2003 08:18:33 -0000	1.136
+++ docs/src/allegro._tx	31 Mar 2003 16:23:46 -0000
@@ -123,6 +123,25 @@
    to this function, because allegro_init() installs it as an atexit() 
    routine so it will be called automatically when your program exits.
 
+@@Macro @END_OF_MAIN();
+@xref Windows specifics, Unix specifics, Differences between platforms
+@xref exhello
+   In order to maintain cross-platform compatibility, you have to put this
+   macro at the very end of your main function. This macro uses some `magic'
+   to mangle your main procedure under platforms which need it like Windows
+   or Linux. In the other platforms this macro compiles to nothing, so you
+   don't have to #ifdef it around. Example:
+<codeblock>
+      int main(void)
+      {
+	 allegro_init();
+	 /* here some more stuff */
+	 ...
+	 return 0;
+      }
+      END_OF_MAIN();
+<endblock>
+
 @@extern char @allegro_id[];
    Text string containing a date and version number for the library, in case 
    you want to display these somewhere.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/