Subversion Repositories Tewi

Rev

Rev 219 | Rev 253 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 219 Rev 240
Line 1... Line 1...
1
/* $Id: server.c 219 2024-10-02 20:40:37Z nishi $ */
1
/* $Id: server.c 240 2024-10-03 05:54:55Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
Line 35... Line 35...
35
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
35
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
36
#ifndef NO_GETADDRINFO
36
#ifndef NO_GETADDRINFO
37
#include <ws2tcpip.h>
37
#include <ws2tcpip.h>
38
#include <wspiapi.h>
38
#include <wspiapi.h>
39
#endif
39
#endif
-
 
40
#ifdef USE_WINSOCK1
-
 
41
#include <winsock.h>
-
 
42
#else
40
#include <winsock2.h>
43
#include <winsock2.h>
-
 
44
#endif
41
#include <process.h>
45
#include <process.h>
42
#include <windows.h>
46
#include <windows.h>
43
 
47
 
44
#include "strptime.h"
48
#include "strptime.h"
45
typedef int socklen_t;
49
typedef int socklen_t;
Line 120... Line 124...
120
 
124
 
121
int tw_server_init(void) {
125
int tw_server_init(void) {
122
	int i;
126
	int i;
123
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
127
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
124
	WSADATA wsa;
128
	WSADATA wsa;
-
 
129
#ifdef USE_WINSOCK1
-
 
130
	WSAStartup(MAKEWORD(1, 1), &wsa);
-
 
131
#else
125
	WSAStartup(MAKEWORD(2, 0), &wsa);
132
	WSAStartup(MAKEWORD(2, 0), &wsa);
126
#endif
133
#endif
-
 
134
#endif
127
	for(i = 0; config.ports[i] != -1; i++)
135
	for(i = 0; config.ports[i] != -1; i++)
128
		;
136
		;
129
	sockcount = i;
137
	sockcount = i;
130
	for(i = 0; config.ports[i] != -1; i++) {
138
	for(i = 0; config.ports[i] != -1; i++) {
131
		int yes = 1;
139
		int yes = 1;