Re: [AD] A5 END_OF_MAIN() exorcism progress |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2009-06-21, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> My local sandbox currently doesn't need END_OF_MAIN() anymore on OS X.
> The only caveat is that for C++, the prototype has to be "int
> main(int, char**)" - unless Allegro isn't allowed to steal the main
> function, in which case the user is responsible for doing whatever
> Allegro needs the user to do in main().
>
> In the course of the week (possibly running into next week, but
> hopefully not too much), I will:
>
> 1. Move the OS X main.m file from the main library into an addon. The
> proper way to link Allegro on OS X then becomes "link to liballegro
> and liba5-main".
Perhaps with pkg-config it could be automatic?
> 2. Merge in Elias' previous patches for Windows and Linux, although
> magic main was pretty much a no-op in the latter case already and can
> be avoided in the former case as well (MinGW doesn't need it, MSVC
> doesn't need it after setting a #pragma; this should again be
> configurable of course).
>
> At that point I will post the patch for review. I am fairly adamant in
> wanting to call the entry point in my main sourcefile "main()", no
> "al_main()" or "allegro_main()". Just "main()".
> However, what I will probably do is make the code so that "main" and
> "allegro_main" mean the same thing, since having "allegro_main" as the
> entry point seems to have at least some supporters.
> In cases where Allegro needs to "steal" main(), that means "#define
> main allegro_main".
> In cases where Allegro doesn't need to steal main(), that means
> "#define allegro_main main".
> If Allegro should not steal main() ("#define ALLEGRO_NO_MAGIC_MAIN",
> do we keep this?), neither of those is done. The entry point is called
> main() and the user is responsible for doing any initialisation that
> Allegro requires themselves and does not link to liba5-main.
>
> Once the patch has been verified to work on all platforms and no one
> has serious complaints, I'll clean up the examples and demo program,
> document the change and commit.
>
> Thoughts?
Having *either* allegro_main() or main() seems unnecessary,
but I will wait for the patch.
Peter