Re: [AD] END_OF_MAIN, again

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



On 8/1/05, Chris <chris.kcat@xxxxxxxxxx> wrote:
What about _mangled_cpp_main(int, char**, char**)?
 
_WinMain threats all _mangled_main as int (*)(int, char **) so unleass someone add support for third argument there is no point in using it.
 
On 8/1/05, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
But if Allegro is compiled a a library, how does it know if it should call
_mangled_cpp_main or _mangeled_c_main? In other words, it does not know -
and should not care - if it is being linked against a C or a C++
programme.
 
Defining takes when compiling user code, not library. Allegro doesn't care because it will call all versions of main. Linker will resolve one of them with user _mangled_main and other with dummy Allegro's version.

 
What about _mangled_c_main(void)? Why can't you define one and just call
that?
 
They will produce same symbol, so it doesn't matter.
 
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.

Can you please repeat why you are doing it this way?
 
I'm doing this because I can have three different symbols for _mangled_main (C, C++(void) and C++(int, char **)) and I have to cover them all.
 


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