Re: [AD] END_OF_MAIN, again |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] END_OF_MAIN, again
- From: Hrvoje Ban <spoofer255@xxxxxxxxxx>
- Date: Mon, 1 Aug 2005 23:28:40 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=GA3XAkKHmeYCdbE/5s9V/gd9UpEuH3pN085HFq7FlEJopQEw5ZLJpAnt7LbFC8xEBWnveB0I6OK2AKc+4RddZowndLgcd99zDHBk6cFZ4xCJQGUHN5cjwHcBVgDvozRmZRXUOT5r2DIgvbEat3m61RvsRCYdpsvIUJmud2tjsPo=
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