Re: [AD] Magic main UNIX, final (?) take |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Wed, Aug 25, 2004, Evert Glebbeek wrote:
> +#undef END_OF_MAIN
> +#ifdef ALLEGRO_WITH_MAGIC_MAIN
> +
> /* magic to capture name of executable file */
> extern int __crt0_argc;
> extern char **__crt0_argv;
> @@ -28,13 +31,13 @@
> #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
This means that legacy programs will no longer compile. Please keep
the END_OF_MAIN definition, even if it's empty:
> +#ifdef ALLEGRO_WITH_MAGIC_MAIN
>
> static char *_allegro_program_arguments[] = { "./unknown", 0 };
>
> int __crt0_argc = 1;
> char **__crt0_argv = _allegro_program_arguments;
>
> +#endif
And this means that a program built against the old allegro will
not run with the newest; I think it's better to keep __crt0_argc and
__crt0_argv even if we don't use them.
--
Sam.