Re: [AD] Planning 4.9.10

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


Evert Glebbeek wrote:
On 12 Apr 2009, at 22:32 , Peter Wang wrote:
In a couple of weeks it should be about time for 4.9.10.  We should
start on the END_OF_MAIN change about now, and by "we" I mean Elias :)

I'll go through Elias' latest patch and try things out on OS X.

I don't think there should be a problem. The "main" function already was inside main.m - so basically instead of the END_OF_MAIN() macro the OSX port now has this:

#define main al_main

And then al_main() is called from within the real main residing inside Allegro.

Linux doesn't need any of this any and the real main can as well be the real main (but in light of possible library wrappers it might make sense to have the user main be "al_main" under all platforms, so the real main can be defined by the wrapper).

The only problem is Windows where there simply is no "main" function, instead the program entry point is WinMain.

At least that's how it is in A4. Someone said there's a compiler switch to make mingw recognize a "main" function - but the question is, do we want to force such a compiler switch, and can it also work with other compilers?

The solution I attempted in the patch is to do it like under OSX - have a functionc alled "WinMain" inside the DLL. But that fails - most likely because I don't know anything about DLLs and what the "declspec" stuff is for. Maybe someone who understands how this works could fix it.

But chances are, there is a requirement for WinMain to be in the EXE and not in a DLL, in which case we could do it like SDL does it - have an additional library like their SDL_main which is always statically linked in and conceptually contains nothing but:

WinMain() {al_main();}

--
Elias Pschernig <elias@xxxxxxxxxx>




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