Re: [AD] Proposal for first step towards new api

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


On 2001-12-18, Henrik Stokseth <hstokset@xxxxxxxxxx> wrote:
> 
> The preprocessor trickery with renaming main in some cases, can be avoided.
> I've looked a bit closer at the actual code now. I can rewrite it in such a
> way that the main entry point function is put in a header file, and it calls
> al_main() in the user program, no problem.

What happens if you include the header in multiple source files?


Actually, I was wondering if we could just provide the `WinMain' stub
in a macro that expands to calling `main'.

#ifdef ALLEGRO_WINDOWS
        #define AL_WINMAIN_STUB()       \
                blah WinMain(blah)      \
                { .... main(blah); ... }
#else
	#define AL_WINMAIN_STUB()
#endif

END_OF_MAIN() is only _needed_ under Windows, IIRC.
If the user doesn't care about Windows, just don't write
AL_WINMAIN_STUB().  It would also help with loading Allegro
dynamically from a shared library (right now it depends on
finding the `_mangled_main' symbol under Unices).



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