Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] Re: (PR#9433) Patch: MSVC compile fixes
Home

[Freeciv-Dev] Re: (PR#9433) Patch: MSVC compile fixes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9433) Patch: MSVC compile fixes
From: "res" <resqu@xxxxxx>
Date: Tue, 20 Jul 2004 03:53:10 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9433 >

On 20.07.2004 05:11, Jason Short wrote:

> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9433 >
> 
>>[resqu@xxxxxx - Tue Jul 20 02:11:39 2004]:
>>
>>A few changes to the server and the GTK 2.0 client to allow compilation 
>>with MSVC:
>>- VC doesn't know dynamic array sizes; instead, alloca() has to be used. 
>>Added a macro(FC_DYNSIZE_ARRAY) to utility/mem.h that wraps GCC's 
>>dynamic sized resp. alloca() as appopriate.
> 
> Alloca is terrible.  Dynamic array sizes are part of C99.  Are you sure
> MSVC doesn't support it?

Arrays are indded nicer, but the manual says: "Microsoft® C conforms to 
the standard for the C language as set forth in the 9899:1990 edition of 
the ANSI C standard." No C99. (Note: I'm speaking about VC7.0. Newer 
versions might have this support, but I don't know.)

>>- VC doesn't know variable argument macros; for now, the patch 
>>effectively disables all functionality provided by such macros.
> 
> This is also part of C99.  But MSVC probably has some unique way (as gcc
> did) to handle this.

If they do they left it out of the manual.

>>- In the GTK2 client, a struct initialization flavor was used that VC 
>>doesn't support.
> 
> Also C99, I think.

See above.

>>- Added some includes needed by VC resp. disabled some not supported.
>>- The Win32 constant for the maximum path length is MAX_PATH, not
> 
> PATH_MAX.
> 
>>NB: To compile FreeCiv with MSVC those changes alone aren't enough. 
>>Project files and a special config.h are needed, too.
> 
> 
> Is it worth it?

I think so. MSVC isn't a bad compiler, and it's (mostly) nice to develop 
with (the debugger is very useful; manual management of files in 
projects sucks sometimes). Also IMO open source projects should try to 
build on more reasonable compilers than gcc - tho I don't expect FreeCiv 
to compile on TurboC or so, the fixes to have it compile on VC are small 
enough (except fixing the vararg macros :P). About the effort of 
creating projects & special config, I've done that already. Keeping the 
projects etc in sync with the actual project takes of course some 
effort, too. What I can't tell of course whether VC support is worth in 
terms of users, ie whether people will actually compile FC with VC.

-f.r.





[Prev in Thread] Current Thread [Next in Thread]