Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: win32 build failure in lockfile.c
Home

[Freeciv-Dev] Re: win32 build failure in lockfile.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: win32 build failure in lockfile.c
From: Jason Short <jshort@xxxxxxxxxxxxxx>
Date: Mon, 21 Jul 2003 21:29:28 -0400
Reply-to: jdorje@xxxxxxxxxxxxxxxxxxxxx

Mike Kaufman wrote:
On Mon, Jul 21, 2003 at 08:44:18PM +0000, Per I. Mathisen wrote:

gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../common    -g -O2 -Wall
-Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations
-c `test -f 'lockfile.c' || echo './'`lockfile.c
lockfile.c: In function `create_lock':
lockfile.c:92: warning: implicit declaration of function `flock'
lockfile.c:92: `LOCK_EX' undeclared (first use in this function)
lockfile.c:92: (Each undeclared identifier is reported only once
lockfile.c:92: for each function it appears in.)
lockfile.c:92: `LOCK_NB' undeclared (first use in this function)
lockfile.c: In function `remove_lock':
lockfile.c:120: `LOCK_UN' undeclared (first use in this function)
make[3]: *** [lockfile.o] Error 1
make[3]: Leaving directory `/d/workspace/freeciv/freeciv/server/userdb'

Please advise.


this was expected. It is highly unlikely that win32 has flock() or fcntl()
There will have to be some #ifdef WIN32_NATIVEs in this file.

For now, I would suggest something like:

#ifdef WIN32_NATIVE
  #undef FILE_LOCKING
#endif

Introducing stuff like this is a bad idea.  Better to use autoconf.

But more appropriate would be to apply Jason's autoconf patch (attached)
Perhaps you should look it over and commit it per.

Note this only adds "#define HAVE_FLOCK" and the like. You still need to use them in the code...

#if !defined HAVE_FLOCK
#  undef FILE_LOCKING
#endif

This should have an RT ticket?

jason



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