Re: [AD] END_OF_MAIN, again

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


I think I found solution that shouldn't be troubled by previous problem. First in alwin.h I make that in case file is C++ main is defined to _mangled_cpp_main, else _mangeled_c_main. In wmain.c I forward declare _mangled_c_main(int, char *[]), _mangled_cpp_main() and _mangled_cpp_main(int, char *[]) and assign they address to pointers and invoke all three in WinMain. Since user can/will define only one (_mangled_)main I placed three new files, each contains one version of _mangled_main. S user will define one and linker will include other two, ignoring one that matches user's.
Attachment is zip, but I had to rename so SourceForge doesn't block it.

On 8/1/05, Evert Glebbeek <eglebbk@xxxxxxxxxx > wrote:
Don't do extern int _mangled_main() - since it might be either
_mangled_main(void) or _mangled_main(int, char**).

Well, it is going to be casted to int (*)(int, char **) in _WinMain I don't think that's a issue.

Attachment: main.al
Description: Binary data



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