Re: [AD] Magic main UNIX, final (?) take

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


On Sunday 29 August 2004 04:55, Peter Wang wrote:
> The #undef END_OF_MAIN broke the tree.  Why do you need it?

The original code had
#ifndef ALLEGRO_NO_MAGIC_MAIN
   #define ALLEGRO_MAGIC_MAIN
   #define main _mangled_main
   #undef END_OF_MAIN
   #define END_OF_MAIN() void *_mangled_main_address = (void*) 
_mangled_main;
#else
   #undef END_OF_MAIN
   #define END_OF_MAIN() void *_mangled_main_address;
#endif
and my intention was to simply move the two #undefs outside of the #if 
block. I guess I moved it out one #if block too much. I'll put it back in 
where it was before. Patch attached.

Evert
Index: include/allegro/platform/alunix.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/platform/alunix.h,v
retrieving revision 1.13
diff -u -r1.13 alunix.h
--- include/allegro/platform/alunix.h	28 Aug 2004 19:56:55 -0000	1.13
+++ include/allegro/platform/alunix.h	29 Aug 2004 07:05:59 -0000
@@ -25,16 +25,17 @@
 extern int    __crt0_argc;
 extern char **__crt0_argv;
 
-#undef END_OF_MAIN
 #ifdef ALLEGRO_WITH_MAGIC_MAIN
 
-#ifndef ALLEGRO_NO_MAGIC_MAIN
-   #define ALLEGRO_MAGIC_MAIN
-   #define main _mangled_main
-   #define END_OF_MAIN() void *_mangled_main_address = (void*) _mangled_main;
-#else
-   #define END_OF_MAIN() void *_mangled_main_address;
-#endif
+   #ifndef ALLEGRO_NO_MAGIC_MAIN
+      #define ALLEGRO_MAGIC_MAIN
+      #define main _mangled_main
+      #undef END_OF_MAIN
+      #define END_OF_MAIN() void *_mangled_main_address = (void*) _mangled_main;
+   #else
+      #undef END_OF_MAIN
+      #define END_OF_MAIN() void *_mangled_main_address;
+   #endif
 
 #endif
 


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