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: Chris <chris.kcat@xxxxxxxxxx>
- Date: Tue, 2 Aug 2005 01:48:48 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=ss2Q1gzrRqP8o6gq6hXnbJYC8Vrew0A7t+XVxLSxBvUeR66pZ3P07k+T48YLSE3u8u+Xz6Bkw8MSIgPp/4tbl5ra0E9htB+IplHjJ5ucPWwY87LZuc04v5KaFOBv7y/tFYppo3dbjYscKjVvZoWIJzVxMFSFoMU1rYnRfu8iLxI=
On Tuesday 02 August 2005 12:31 am, Hrvoje Ban wrote:
> > Also, Allegro is a C library. It can't contain C++ code.
>
> Since Allegro already check's for C++ support, it isn't hard make some
> modification so it only support C style _mangled_main if needed.
Allegro only does proper checking when compiling the C++ test. If the C++ test
fails, it simply skips building it. However, since using C++ symbols for
_mangled_main would require a C++ compiler when building Allegro, I don't
think that will be acceptable.
However, I did just get an extremely evil idea. I would assume MSVC has a way
to run a function before main/WinMain? As I understand it, there should be a
way to dynamicly load the executable being run (like if you call
dlopen(NULL, ...) in Unix), and get access to its symbols. We could do that
in a pre-WinMain constructor and grab _mangled_main's address, so when
WinMain is actually run, it has the pointer ready to use. I'm not quite sure
how to grab C++ symbols, though.. but there should be a way.