Changeset - r27586:de8b0209a8bd
README.md
Show inline comments
 
@@ -174,9 +174,6 @@ See `src/3rdparty/squirrel/COPYRIGHT` fo
 
The md5 implementation in `src/3rdparty/md5` is licensed under the Zlib license.
 
See the comments in the source files in `src/3rdparty/md5` for the complete license text.
 

	
 
The implementations of Posix `getaddrinfo` and `getnameinfo` for OS/2 in `src/3rdparty/os2` are distributed partly under the GNU Lesser General Public License 2.1, and partly under the (3-clause) BSD license.
 
The exact licensing terms can be found in `src/3rdparty/os2/getaddrinfo.c` resp. `src/3rdparty/os2/getnameinfo.c`.
 

	
 
The fmt implementation in `src/3rdparty/fmt` is licensed under the MIT license.
 
See `src/3rdparty/fmt/LICENSE.rst` for the complete license text.
 

	
os/os2/build_lang.cmd
Show inline comments
 
deleted file
os/os2/dedicated.cmd
Show inline comments
 
deleted file
os/os2/installer/download_nosound.cmd
Show inline comments
 
deleted file
os/os2/installer/download_opengfx.cmd
Show inline comments
 
deleted file
os/os2/installer/download_opensfx.cmd
Show inline comments
 
deleted file
os/os2/installer/make_installer.cmd
Show inline comments
 
deleted file
os/os2/installer/openttd.wis
Show inline comments
 
deleted file
os/os2/installer/remove_nosound.cmd
Show inline comments
 
deleted file
os/os2/installer/remove_opengfx.cmd
Show inline comments
 
deleted file
os/os2/installer/remove_opensfx.cmd
Show inline comments
 
deleted file
os/os2/openttd.wpj
Show inline comments
 
deleted file
os/os2/svn_version.cmd
Show inline comments
 
deleted file
os/os2/svnver1.c
Show inline comments
 
deleted file
os/os2/svnver2.c
Show inline comments
 
deleted file
src/3rdparty/CMakeLists.txt
Show inline comments
 
@@ -4,4 +4,3 @@ add_subdirectory(icu)
 
add_subdirectory(md5)
 
add_subdirectory(squirrel)
 
add_subdirectory(opengl)
 
add_subdirectory(os2)
src/3rdparty/os2/CMakeLists.txt
Show inline comments
 
deleted file
src/3rdparty/os2/getaddrinfo.c
Show inline comments
 
deleted file
src/3rdparty/os2/getaddrinfo.h
Show inline comments
 
deleted file
src/3rdparty/os2/getnameinfo.c
Show inline comments
 
deleted file
src/3rdparty/os2/getnameinfo.h
Show inline comments
 
deleted file
src/cpu.cpp
Show inline comments
 
@@ -32,13 +32,6 @@ uint64 ottd_rdtsc()
 
#define RDTSC_AVAILABLE
 
#endif
 

	
 
/* rdtsc for OS/2. Hopefully this works, who knows */
 
#if defined (__WATCOMC__) && !defined(RDTSC_AVAILABLE)
 
unsigned __int64 ottd_rdtsc();
 
# pragma aux ottd_rdtsc = 0x0F 0x31 value [edx eax] parm nomemory modify exact [edx eax] nomemory;
 
# define RDTSC_AVAILABLE
 
#endif
 

	
 
/* rdtsc for all other *nix-en (hopefully). Use GCC syntax */
 
#if (defined(__i386__) || defined(__x86_64__)) && !defined(RDTSC_AVAILABLE)
 
uint64 ottd_rdtsc()
src/crashlog.cpp
Show inline comments
 
@@ -88,8 +88,6 @@ void CrashLog::LogCompiler(std::back_ins
 
			"ICC {}", __ICC
 
#elif defined(__GNUC__)
 
			"GCC {}.{}.{}", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__
 
#elif defined(__WATCOMC__)
 
			"WatcomC {}", __WATCOMC__
 
#else
 
			"<unknown>"
 
#endif
src/fileio.cpp
Show inline comments
 
@@ -347,8 +347,6 @@ void FioCreateDirectory(const std::strin
 
	 * of the time they are 'directory already exists' errors anyhow. */
 
#if defined(_WIN32)
 
	CreateDirectory(OTTD2FS(name).c_str(), nullptr);
 
#elif defined(OS2) && !defined(__INNOTEK_LIBC__)
 
	mkdir(OTTD2FS(name).c_str());
 
#else
 
	mkdir(OTTD2FS(name).c_str(), 0755);
 
#endif
 
@@ -724,7 +722,7 @@ bool ExtractTar(const std::string &tar_f
 
/**
 
 * Determine the base (personal dir and game data dir) paths
 
 * @param exe the path from the current path to the executable
 
 * @note defined in the OS related files (os2.cpp, win32.cpp, unix.cpp etc)
 
 * @note defined in the OS related files (win32.cpp, unix.cpp etc)
 
 */
 
extern void DetermineBasePaths(const char *exe);
 
#else /* defined(_WIN32) */
 
@@ -846,7 +844,7 @@ void DetermineBasePaths(const char *exe)
 
	}
 
#endif
 

	
 
#if defined(OS2) || !defined(WITH_PERSONAL_DIR)
 
#if !defined(WITH_PERSONAL_DIR)
 
	_searchpaths[SP_PERSONAL_DIR].clear();
 
#else
 
	if (!homedir.empty()) {
src/fios.cpp
Show inline comments
 
@@ -34,7 +34,7 @@
 
static std::string *_fios_path = nullptr;
 
SortingBits _savegame_sort_order = SORT_BY_DATE | SORT_DESCENDING;
 

	
 
/* OS-specific functions are taken from their respective files (win32/unix/os2 .c) */
 
/* OS-specific functions are taken from their respective files (win32/unix .c) */
 
extern bool FiosIsRoot(const std::string &path);
 
extern bool FiosIsValidFile(const std::string &path, const struct dirent *ent, struct stat *sb);
 
extern bool FiosIsHiddenFile(const struct dirent *ent);
 
@@ -143,7 +143,7 @@ bool FiosBrowseTo(const FiosItem *item)
 
{
 
	switch (item->type) {
 
		case FIOS_TYPE_DRIVE:
 
#if defined(_WIN32) || defined(__OS2__)
 
#if defined(_WIN32)
 
			assert(_fios_path != nullptr);
 
			*_fios_path = std::string{ item->title, 0, 1 } + ":" PATHSEP;
 
#endif
src/music/CMakeLists.txt
Show inline comments
 
@@ -36,12 +36,6 @@ if(NOT OPTION_DEDICATED)
 
        bemidi.h
 
        CONDITION HAIKU
 
    )
 

	
 
    add_files(
 
        os2_m.cpp
 
        os2_m.h
 
        CONDITION OPTION_OS2
 
    )
 
endif()
 

	
 
add_files(
src/music/os2_m.cpp
Show inline comments
 
deleted file
src/music/os2_m.h
Show inline comments
 
deleted file
src/network/core/address.cpp
Show inline comments
 
@@ -316,13 +316,11 @@ static SOCKET ListenLoopProc(addrinfo *r
 
		Debug(net, 0, "Setting reuse-address mode failed: {}", 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: {}", NetworkError::GetLast().AsString());
 
	}
 
#endif
 

	
 
	if (bind(sock, runp->ai_addr, (int)runp->ai_addrlen) != 0) {
 
		Debug(net, 0, "Could not bind socket on {}: {}", address, NetworkError::GetLast().AsString());
src/network/core/os_abstraction.cpp
Show inline comments
 
@@ -118,8 +118,6 @@ bool NetworkError::HasError() const
 
{
 
#if defined(_WIN32)
 
	return NetworkError(WSAGetLastError());
 
#elif defined(__OS2__)
 
	return NetworkError(sock_errno());
 
#else
 
	return NetworkError(errno);
 
#endif
src/network/core/os_abstraction.h
Show inline comments
 
@@ -60,7 +60,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
 
@@ -79,7 +79,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
 
@@ -117,60 +117,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
 

	
 
/* 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()
src/os/CMakeLists.txt
Show inline comments
 
add_subdirectory(macosx)
 
add_subdirectory(os2)
 
add_subdirectory(unix)
 
add_subdirectory(windows)
src/os/os2/CMakeLists.txt
Show inline comments
 
deleted file
src/os/os2/os2.cpp
Show inline comments
 
deleted file
src/os/os2/os2_main.cpp
Show inline comments
 
deleted file
src/os/unix/CMakeLists.txt
Show inline comments
 
add_files(
 
    crashlog_unix.cpp
 
    survey_unix.cpp
 
    CONDITION UNIX AND NOT APPLE AND NOT OPTION_OS2
 
    CONDITION UNIX AND NOT APPLE
 
)
 

	
 
add_files(
 
    unix.cpp
 
    CONDITION UNIX AND NOT OPTION_OS2
 
    CONDITION UNIX
 
)
 

	
 
add_files(
 
@@ -14,6 +14,6 @@ add_files(
 
    CONDITION Fontconfig_FOUND
 
)
 

	
 
if(UNIX AND NOT APPLE AND NOT OPTION_OS2)
 
if(UNIX AND NOT APPLE)
 
    target_sources(openttd PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/unix_main.cpp)
 
endif()
src/stdafx.h
Show inline comments
 
@@ -121,14 +121,6 @@
 
#      define NODISCARD [[nodiscard]]
 
#endif
 

	
 
#if defined(__WATCOMC__)
 
#	define NORETURN
 
#	define CDECL
 
#	define FINAL
 
#	define FALLTHROUGH
 
#	include <malloc.h>
 
#endif /* __WATCOMC__ */
 

	
 
#if defined(_WIN32)
 
#	define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 
#endif
 
@@ -236,7 +228,7 @@
 
#	endif /* _WIN32 or WITH_ICONV */
 
#endif /* STRGEN || SETTINGSGEN */
 

	
 
#if defined(_WIN32) || defined(__OS2__) && !defined(__INNOTEK_LIBC__)
 
#if defined(_WIN32)
 
#	define PATHSEP "\\"
 
#	define PATHSEPCHAR '\\'
 
#else
 
@@ -244,7 +236,7 @@
 
#	define PATHSEPCHAR '/'
 
#endif
 

	
 
#if defined(_MSC_VER) || defined(__WATCOMC__)
 
#if defined(_MSC_VER)
 
#	define PACK_N(type_dec, n) __pragma(pack(push, n)) type_dec; __pragma(pack(pop))
 
#elif defined(__MINGW32__)
 
#	define PRAGMA(x) _Pragma(#x)
src/video/dedicated_v.cpp
Show inline comments
 
@@ -25,33 +25,6 @@
 
#include "../window_func.h"
 
#include "dedicated_v.h"
 

	
 
#ifdef __OS2__
 
#	include <sys/time.h> /* gettimeofday */
 
#	include <sys/types.h>
 
#	include <unistd.h>
 
#	include <conio.h>
 

	
 
#	define INCL_DOS
 
#	include <os2.h>
 

	
 
#	define STDIN 0  /* file descriptor for standard input */
 

	
 
/**
 
 * Switches OpenTTD to a console app at run-time, instead of a PM app
 
 * Necessary to see stdout, etc.
 
 */
 
static void OS2_SwitchToConsoleMode()
 
{
 
	PPIB pib;
 
	PTIB tib;
 

	
 
	DosGetInfoBlocks(&tib, &pib);
 

	
 
	/* Change flag from PM to VIO */
 
	pib->pib_ultype = 3;
 
}
 
#endif
 

	
 
#if defined(UNIX)
 
#	include <sys/time.h> /* gettimeofday */
 
#	include <sys/types.h>
 
@@ -160,11 +133,6 @@ const char *VideoDriver_Dedicated::Start
 
	_set_error_mode(_OUT_TO_STDERR);
 
#endif
 

	
 
#ifdef __OS2__
 
	/* For OS/2 we also need to switch to console mode instead of PM mode */
 
	OS2_SwitchToConsoleMode();
 
#endif
 

	
 
	Debug(driver, 1, "Loading dedicated server");
 
	return nullptr;
 
}
 
@@ -181,7 +149,7 @@ void VideoDriver_Dedicated::MakeDirty(in
 
bool VideoDriver_Dedicated::ChangeResolution(int w, int h) { return false; }
 
bool VideoDriver_Dedicated::ToggleFullscreen(bool fs) { return false; }
 

	
 
#if defined(UNIX) || defined(__OS2__)
 
#if defined(UNIX)
 
static bool InputWaiting()
 
{
 
	struct timeval tv;
 
@@ -214,7 +182,7 @@ static void DedicatedHandleKeyInput()
 

	
 
	if (_exit_game) return;
 

	
 
#if defined(UNIX) || defined(__OS2__)
 
#if defined(UNIX)
 
	if (fgets(input_line, lengthof(input_line), stdin) == nullptr) return;
 
#else
 
	/* Handle console input, and signal console thread, it can accept input again */
src/video/sdl_v.cpp
Show inline comments
 
@@ -446,7 +446,7 @@ static uint ConvertSdlKeyIntoMy(SDL_keys
 
	}
 

	
 
	/* check scancode for BACKQUOTE key, because we want the key left of "1", not anything else (on non-US keyboards) */
 
#if defined(_WIN32) || defined(__OS2__)
 
#if defined(_WIN32)
 
	if (sym->scancode == 41) key = WKC_BACKQUOTE;
 
#elif defined(__APPLE__)
 
	if (sym->scancode == 10) key = WKC_BACKQUOTE;
0 comments (0 inline, 0 general)