Merge branch 'master' into jgrpp
# Conflicts: # os/macosx/notarize.sh # src/3rdparty/CMakeLists.txt # src/3rdparty/squirrel/squirrel/sqcompiler.cpp # src/3rdparty/squirrel/squirrel/sqdebug.cpp # src/3rdparty/squirrel/squirrel/sqvm.cpp # src/console_cmds.cpp # src/core/span_type.hpp # src/crashlog.cpp # src/currency.h # src/date_gui.cpp # src/driver.cpp # src/fios.cpp # src/genworld_gui.cpp # src/hotkeys.cpp # src/misc_gui.cpp # src/music/os2_m.cpp # src/network/core/os_abstraction.h # src/network/network_server.cpp # src/newgrf.cpp # src/newgrf_config.h # src/newgrf_text.cpp # src/openttd.cpp # src/os/macosx/font_osx.cpp # src/os/macosx/misc_osx.cpp # src/os/os2/CMakeLists.txt # src/os/os2/os2.cpp # src/os/unix/CMakeLists.txt # src/os/windows/font_win32.cpp # src/os/windows/win32_main.cpp # src/saveload/saveload.cpp # src/script/api/script_text.cpp # src/settings.cpp # src/settings_gui.cpp # src/stdafx.h # src/strings.cpp # src/timetable_gui.cpp # src/town_gui.cpp # src/train_cmd.cpp # src/video/dedicated_v.cpp # src/video/video_driver.cpp # src/video/win32_v.cpp # src/viewport.cpp # src/waypoint_gui.cpp # src/widgets/dropdown_type.h # src/window.cpp # src/window_gui.h
This commit is contained in:
@@ -340,13 +340,11 @@ static SOCKET ListenLoopProc(addrinfo *runp)
|
||||
DEBUG(net, 0, "Setting reuse-address mode failed: %s", NetworkError::GetLast().AsString());
|
||||
}
|
||||
|
||||
#ifndef __OS2__
|
||||
int on = 1;
|
||||
if (runp->ai_family == AF_INET6 &&
|
||||
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&on, sizeof(on)) == -1) {
|
||||
DEBUG(net, 3, "Could not disable IPv4 over IPv6: %s", NetworkError::GetLast().AsString());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bind(sock, runp->ai_addr, (int)runp->ai_addrlen) != 0) {
|
||||
DEBUG(net, 0, "Could not bind socket on %s: %s", address.c_str(), NetworkError::GetLast().AsString());
|
||||
|
@@ -120,8 +120,6 @@ bool NetworkError::HasError() const
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return NetworkError(WSAGetLastError());
|
||||
#elif defined(__OS2__)
|
||||
return NetworkError(sock_errno());
|
||||
#else
|
||||
return NetworkError(errno);
|
||||
#endif
|
||||
|
@@ -73,7 +73,7 @@ typedef unsigned long in_addr_t;
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/* UNIX stuff */
|
||||
#if defined(UNIX) && !defined(__OS2__)
|
||||
#if defined(UNIX)
|
||||
# if defined(OPENBSD) || defined(__NetBSD__)
|
||||
# define AI_ADDRCONFIG 0
|
||||
# endif
|
||||
@@ -95,7 +95,7 @@ typedef unsigned long in_addr_t;
|
||||
# include <arpa/inet.h>
|
||||
# include <net/if.h>
|
||||
/* According to glibc/NEWS, <ifaddrs.h> appeared in glibc-2.3. */
|
||||
# if !defined(__sgi__) && !defined(SUNOS) && !defined(__INNOTEK_LIBC__) \
|
||||
# if !defined(__sgi__) && !defined(SUNOS) \
|
||||
&& !(defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 2)) && !defined(__dietlibc__) && !defined(HPUX)
|
||||
/* If for any reason ifaddrs.h does not exist on your system, comment out
|
||||
* the following two lines and an alternative way will be used to fetch
|
||||
@@ -133,63 +133,6 @@ typedef unsigned long in_addr_t;
|
||||
|
||||
#endif /* UNIX */
|
||||
|
||||
/* OS/2 stuff */
|
||||
#if defined(__OS2__)
|
||||
# define SOCKET int
|
||||
# define INVALID_SOCKET -1
|
||||
# define closesocket close
|
||||
# define SD_RECEIVE SHUT_RD
|
||||
# define SD_SEND SHUT_WR
|
||||
# define SD_BOTH SHUT_RDWR
|
||||
|
||||
/* Includes needed for OS/2 systems */
|
||||
# include <types.h>
|
||||
# include <unistd.h>
|
||||
# include <sys/ioctl.h>
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
# include <netinet/tcp.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <net/if.h>
|
||||
# include <errno.h>
|
||||
# include <sys/time.h>
|
||||
# include <netdb.h>
|
||||
# include <nerrno.h>
|
||||
# define INADDR_NONE 0xffffffff
|
||||
# include "../../3rdparty/os2/getaddrinfo.h"
|
||||
# include "../../3rdparty/os2/getnameinfo.h"
|
||||
|
||||
#define IPV6_V6ONLY 27
|
||||
|
||||
/*
|
||||
* IPv6 address
|
||||
*/
|
||||
struct in6_addr {
|
||||
union {
|
||||
uint8_t __u6_addr8[16];
|
||||
uint16_t __u6_addr16[8];
|
||||
uint32_t __u6_addr32[4];
|
||||
} __u6_addr; /* 128-bit IP6 address */
|
||||
};
|
||||
|
||||
#define s6_addr __u6_addr.__u6_addr8
|
||||
|
||||
struct sockaddr_in6 {
|
||||
uint8_t sin6_len; /* length of this struct */
|
||||
sa_family_t sin6_family; /* AF_INET6 */
|
||||
in_port_t sin6_port; /* Transport layer port # */
|
||||
uint32_t sin6_flowinfo; /* IP6 flow information */
|
||||
struct in6_addr sin6_addr; /* IP6 address */
|
||||
uint32_t sin6_scope_id; /* scope zone index */
|
||||
};
|
||||
|
||||
typedef int socklen_t;
|
||||
#if !defined(__INNOTEK_LIBC__)
|
||||
typedef unsigned long in_addr_t;
|
||||
#endif /* __INNOTEK_LIBC__ */
|
||||
|
||||
#endif /* OS/2 */
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
/**
|
||||
* Emscripten doesn't set 'addrlen' for accept(), getsockname(), getpeername()
|
||||
|
Reference in New Issue
Block a user