Re: [AD] END_OF_MAIN removal patch for msvc

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


Evert Glebbeek wrote:
On 16 Nov 2008, at 18:09, torhu wrote:
I've had some trouble building allegro 5 on msvc, but now I've got it working. So I've attached a patch which makes END_OF_MAIN just an empty macro on msvc.

Cool. Is there a similar way to do it for MinGW?

IIRC, mingw doesn't care either way. It's an msvc restriction. But the patch removes END_OF_MAIN for all Windows compilers.


1) This means that apps built with allegro 5 on msvc will by default have a console window. But this is what happens on other Windows compilers already, at least mingw does this. So how to disable the console will definitely become a FAQ for msvc users. Adding the required linker option to allegro headers is an option. See below.

#ifdef ALLEGRO_USE_CONSOLE
  #pragma comment(linker,"/SUBSYSTEM:windows").
#endif

Not sure I like this, though.  Seems a bit over the top, or what?

Shouldn't that be #ifndef?

Yup.

Anyway, I personally generally dislike #pragma's, but in this case I'll go practical and say I have no opinion either way. If we want to be newbie-friendly it might be a good idea to have it (my suspicion is there'll be more newbies using MSVC than MinGW).

MSVC users need instructions for getting started with Allegro anyway, telling them how to change this setting shouldn't add much to them. On the other hand, I don't know how common using the console with msvc apps really is, if you're building a graphical app. I tend to use it for debug output and then disable it in release builds, but I don't know if that's just me being more used to working on the command line.




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