[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] 4.1.17
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Tue, 30 Nov 2004 02:29:55 -0800
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:return-path:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:x-enigmail-version:x-enigmail-supports:content-type:content-transfer-encoding; b=mVSyjRp+U3SUNO/9C+2SIGX9R1c8XweUeY8Nb/iJMsNN5+ryVLpDURAUn3awZDkIbpZMALdHcfluwtluP+wIW4CF+CV03jBCB3KDO/XzUbvTjzDym8ooR9eIOU/kUOIcDAV5kBaiJu3RGOuYeGq2o4x27SLVOSgJxjSs0Nzqo8U=
Evert Glebbeek wrote:
Maybe I just assumed there were others because END_OF_MAIN() keeps poping
up as something we can't solve on MacOS X...
I just thought of something...
In the lib:
#undef main
int main(int argc, char *argv[], char *arz[])
{
void *mangled_main_addr = _mangled_main;
whatever_magic_stuff_needed();
return ((int(*)(int,char*[],char*[]))mangled_main_addr)(argc, argv,
argz);
}
And in the headers:
#define main _mangled_main
The user's main function will become _mangled_main, and the main
function in the lib will call it however needed. END_OF_MAIN not required.