Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2001:
[Freeciv-Dev] Re: Winsock patch
Home

[Freeciv-Dev] Re: Winsock patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Winsock patch
From: Andreas Kemnade <akemnade@xxxxxxxxxxx>
Date: Mon, 12 Feb 2001 14:54:33 +0100 (CET)

Jeff Mallatt writes:
 > At 2001/02/10 13:35 , Vasco Alexandre Da Silva Costa wrote:
 > >Here is yet another slightly changed version of Andreas's patch.
 > >
 > >After it's tested if it works in Windows (could you please do it Andreas?) 
 > >If there's nothing wrong with it and noone objects it will be commited.
 > 
 > A few problems with the patch:
 > 
 > - It moves some includes from .c file to .h files *that don't use them*.
 > Because of some conflicts I have encountered with trying to compile these
 > includes on some versions, I prefer them to remain where they were.
 > 
 > - The coding style doesn't match Freeciv's standard.  Worse, the patch
 > RE-formats some things from conformant to non-conformant (e.g., netintf.h).
 > 
 > - The config stuff for fdopen() doesn't work.
 > 
 > - The config stuff is platform-oriented (e.g. WIN32_NATIVE (also, it uses
 > HAVE_WINSOCK_H to condition code, not just includes), instead of
 > function-oriented (e.g., HAVE_RECV).  I realize this is a difficult issue,
 > and it may be as close as it can get, but to me it appears to need a second
 > look.
 > 
That's difficult. We need testing code like this:
#ifdef HAVE_WINSOCK_H
int __stdcall recv(int,void *,int,int)
#else
int recv(int, void *,int,int);
main()
{
   recv(0,NULL,0,0);
}

Winsock32.dll has a symbol called recv@16, but no recv.

AFAIK cygwin1.dll has recv. I don't like this kind of code. 
The __stdcall attribute makes gcc convert the symbol.
 > It now seems to work on Linux.  It needs to be tested on Windows (and BeOS).
It also works on Windows.

 > 
 > At 2001/02/11 07:36 , Andreas Kemnade wrote:
 > >Some modifications are needed:
 > >It is safer to use _beginthreadex instead of CreateThread because some
 > >C-Lib data structs are initialized then but it has a strange prototype,
 > >so some casts are necessary. I have looked into my win32 book for this.
 > 
 > I didn't include Andreas' patch, though it should be before being
 > committed.  (If whoever tests this on Windows would combine the patches,
 > that would be greatly appreciated.)
 > 
Done. complete patch is attached. winsock.h was not included at many
places!

Greetings
Andreas Kemnade

Attachment: win32-8.diff.gz
Description: Binary data


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