Re: [AD] END_OF_MAIN, again

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


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.




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