[Freeciv-Dev] Winsock patch
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Vasco Alexandre Da Silva Costa writes:
> 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.
>
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.
Greetings
Andreas Kemnade
BTW: Is the other SOCKET_ZERO_ISNT_STDIN stuff only used on BeOS?
--- freeciv/common/support.c Sun Feb 11 13:23:22 2001
+++ freeciv-w2/common/support.c Sun Feb 11 12:54:35 2001
@@ -478,7 +478,7 @@
static HANDLE mythread=INVALID_HANDLE_VALUE;
-static DWORD WINAPI thread_proc(LPVOID)
+static DWORD WINAPI thread_proc(LPVOID data)
{
if (fgets(mybuf, MYBUFSIZE, stdin)) {
char *s;
@@ -491,13 +491,14 @@
void my_init_console(void)
{
- DWORD threadid;
+ unsigned int threadid;
if (mythread!=INVALID_HANDLE_VALUE)
return;
- buf[0]='\0';
- mythread=CreateThread(NULL, 0, thread_proc, NULL, 0, &threadid);
+ mybuf[0]='\0';
+ mythread=(HANDLE)_beginthreadex(NULL, 0,thread_proc,
+ NULL, 0, &threadid);
}
/* The return of my_read_console() is in a statically allocated buffer.
- [Freeciv-Dev] Winsock patch, Vasco Alexandre Da Silva Costa, 2001/02/10
- [Freeciv-Dev] Winsock patch,
Andreas Kemnade <=
- [Freeciv-Dev] Re: Winsock patch, Jeff Mallatt, 2001/02/12
- [Freeciv-Dev] Re: Winsock patch, Andreas Kemnade, 2001/02/12
- [Freeciv-Dev] Re: Winsock patch, Vasco Alexandre Da Silva Costa, 2001/02/12
- [Freeciv-Dev] Re: Winsock patch, Andreas Kemnade, 2001/02/13
- [Freeciv-Dev] Re: Winsock patch, Jeff Mallatt, 2001/02/13
- [Freeciv-Dev] Re: Winsock patch, Andreas Kemnade, 2001/02/13
- [Freeciv-Dev] Re: Winsock patch, Jeff Mallatt, 2001/02/13
- [Freeciv-Dev] Re: Winsock patch, Andreas Kemnade, 2001/02/14
- [Freeciv-Dev] Re: Winsock patch, Sebastian Bauer, 2001/02/13
- [Freeciv-Dev] Re: Winsock patch, Dirk Stoecker, 2001/02/14
|
|