Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2005:
[Freeciv-Dev] Trouble compiling SVN code
Home

[Freeciv-Dev] Trouble compiling SVN code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Trouble compiling SVN code
From: "Homr Zodyssey" <programmer@xxxxxxxxxxxx>
Date: Wed, 23 Nov 2005 14:07:12 -0500

I've been trying for a couple days now to get the latest code from SVN to compile under MinGW.  I can compile 2.0.7 just fine. 
 
First I ran into a problem that has been mentioned on the forums.  "configure.ac" has some line-endings that don't seem to groove with MinGW's autoheader.
 
Then, I found some syntax errors in client/server.c.  Possibly they went undetected because they are inside an "#ifdef WIN32_NATIVE" section. 
 
I'm still a noob, so I havent quite figured out a good way to make a diff/patch.  (Any pointers would help -- I'm using Eclipse with the Subclipse plug-in to access Subversion).  So anyway, I'll just describe the needed changes.
 
First off, we need to #include "rand.h" -- possibly within an "#ifdef WIN32_NATIVE".  myrand() is only called once in this file and its inside the aforementioned "#ifdef WIN32_NATIVE" section.
 
Second, on line 334,
    cat_snprintf(filename, sizeof(filename) "fctmp%d", myrand());
 
needs to change to
    cat_snprintf(filename, sizeof(filename), "fctmp%d", myrand(1000)); /* I just picked 1000 as it seemed lika  good number to me.  */
 
Third, on line 422, there is this line:
    if (errno == EINPROGRESS) {
 
However, EINPROGRESS which is undefined in winsock.  I changed it to WSAEINPROGRESS, and it compiled.  This should prolly look like this:
#ifdef HAVE_WINSOCK
    if (errno == WSAEINPROGRESS) {
#else
    if (errno == EINPROGRESS) {
#endif
 
If someone can tell my noob-butt how to make patch, I'll post one.  Or, if I'm just a doofus who doesnt know how to compile properly, you can tell me that too.
 
--Homr Zodyssey

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Trouble compiling SVN code, Homr Zodyssey <=