Re: [AD] got rid of END_OF_MAIN() |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Monday 09 August 2004 03:10, Michael Benfield wrote:
> Attached is a patch which makes it unnecessary to use the END_OF_MAIN
> macro for all platforms. The main function is still mangled, but the
> macro is no longer necessary.
I tried a (modified) version of your patch in Windows (the modification
consisted of using a function pointer to get around the requirement of
using int main(int argc char ** argv)). I'm afraid I experienced some
problems with it.
First of all, I had to use static link because the DLL can't acces the
symbol main() (renamed to _mangled_main) from the user code. Maybe there's
a way to link the portion of the library code that needs to do that
statically though and work around that problem. I haven't looked into
that.
What's worse is that I couldn't find a way to disable the magic main
mangling for programs that defined their own WinMain. Unless there's a
clever trick I missed, I think that pretty much means we can't do this...
unfortunately.
Evert