mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 00:10:40 +00:00
mingw build fixes again (including mostly working in sid: got some link issues)
This commit is contained in:
parent
8b15be4ced
commit
06da30ac89
8 changed files with 39 additions and 10 deletions
|
@ -88,6 +88,7 @@ qw_server_LDFLAGS= $(common_ldflags)
|
|||
qw_server_DEPENDENCIES= libqfnet.la $(ASM) $(qf_server_LIBS)
|
||||
|
||||
qw_master_SOURCES= master.c
|
||||
qw_master_LDADD= $(NET_LIBS)
|
||||
qw_master_LDFLAGS= $(common_ldflags)
|
||||
|
||||
qf_client_LIBS= $(top_builddir)/libs/video/targets/libQFjs.la \
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
@ -302,18 +305,20 @@ QW_Master (struct sockaddr_in *addr)
|
|||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
struct sockaddr_in addr;
|
||||
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
addr.sin_port = htons (27000);
|
||||
short port = htons (27000);
|
||||
#ifndef WIN32 //FIXME
|
||||
int c;
|
||||
|
||||
while ((c = getopt (argc, argv, "p:")) != -1) {
|
||||
if (c == 'p') {
|
||||
addr.sin_port = htons (atoi (optarg));
|
||||
port = htons (atoi (optarg));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
addr.sin_port = port;
|
||||
QW_Master (&addr);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -1108,8 +1111,14 @@ SV_PrintIP (byte *ip)
|
|||
static char buf[INET6_ADDRSTRLEN];
|
||||
if (!inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN))
|
||||
#else
|
||||
# ifdef WIN32
|
||||
static char buf[16];
|
||||
strcpy (buf, inet_ntoa (*(struct in_addr*)ip));
|
||||
if (0)
|
||||
# else
|
||||
static char buf[INET_ADDRSTRLEN];
|
||||
if (!inet_ntop (AF_INET, ip, buf, INET_ADDRSTRLEN))
|
||||
# endif
|
||||
#endif
|
||||
Sys_Error ("SV_CleanIPList: inet_ntop_failed. wtf?\n");
|
||||
return buf;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue