Re: [AD] No need for END_OF_MAIN (Windows) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] No need for END_OF_MAIN (Windows)
- From: <spoofer255@xxxxxxxxxx>
- Date: Sat, 14 May 2005 18:36:43 +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:content-transfer-encoding:content-disposition:references; b=msJ8Y0uIsg0YnU03ZyhB3dPRTVBJnmjU6x2b9PUILai4CkaiewpGasUMli9/ctwhXZfTgVDbQgphEDHKnRTL/Pm5drkwmvL92vyICcsbvs6ZXNP/YYpyAz4EYNO/iR/Agpv3wxaMC0uUuREX2h/Un524bD/RRSqAw+s1WEWKgKs=
How about this:
allegro header:
#define main _mangled_main
allegro source:
int _mangled_main();
int __stdcall WinMain(void *hInst, void *hPrev, char *Cmd, int nShow)
{
return _WinMain((void *)_mangled_main, hInst, hPrev, Cmd, nShow);
}
If I get this right _mangled_main inside library will be unresolved
(weak link or whatever) after building library and resolved to user
main() during final linking.
I made small example that has main() inside library (.a) and calls
function that is inside user code and it works :)