mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-13 06:13:18 +00:00
RETURN OF THE PORTS CHOPPING BLOCK: Destroy DOS!
Remove all remaining traces of the following macros for the obsolete DOS port, which were missed previously: * `DJGPP` * `__DJGPP__` * `DJGPPDOS` * `PC_DOS` * `WATTCP` May get rid of `MSDOS` later once I get word on whether I should kill it or not
This commit is contained in:
parent
2aaaddae7c
commit
ee8acccd3c
10 changed files with 8 additions and 134 deletions
|
@ -98,7 +98,6 @@ ALL_SYSTEMS=\
|
||||||
MINGW64\
|
MINGW64\
|
||||||
HAIKU\
|
HAIKU\
|
||||||
DUMMY\
|
DUMMY\
|
||||||
DJGPPDOS\
|
|
||||||
MINGW\
|
MINGW\
|
||||||
UNIX\
|
UNIX\
|
||||||
LINUX\
|
LINUX\
|
||||||
|
@ -622,8 +621,6 @@ asm:
|
||||||
$(REMOVE) $(OBJDIR)/tmp.exe
|
$(REMOVE) $(OBJDIR)/tmp.exe
|
||||||
|
|
||||||
# executable
|
# executable
|
||||||
# NOTE: DJGPP's objcopy do not have --add-gnu-debuglink
|
|
||||||
|
|
||||||
$(BIN)/$(EXENAME): $(POS) $(OBJS)
|
$(BIN)/$(EXENAME): $(POS) $(OBJS)
|
||||||
-$(MKDIR) $(BIN)
|
-$(MKDIR) $(BIN)
|
||||||
$(call echo,Linking $(EXENAME)...)
|
$(call echo,Linking $(EXENAME)...)
|
||||||
|
|
|
@ -40,10 +40,6 @@ void D_SRB2Main(void);
|
||||||
|
|
||||||
// Called by IO functions when input is detected.
|
// Called by IO functions when input is detected.
|
||||||
void D_PostEvent(const event_t *ev);
|
void D_PostEvent(const event_t *ev);
|
||||||
#if defined (PC_DOS) && !defined (DOXYGEN)
|
|
||||||
void D_PostEvent_end(void); // delimiter for locking memory
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void D_ProcessEvents(void);
|
void D_ProcessEvents(void);
|
||||||
|
|
||||||
const char *D_Home(void);
|
const char *D_Home(void);
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#if defined (_WIN32) || defined (__DJGPP__)
|
#ifdef _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#else
|
#else
|
||||||
|
@ -30,10 +30,6 @@
|
||||||
#elif defined (_WIN32)
|
#elif defined (_WIN32)
|
||||||
#include <sys/utime.h>
|
#include <sys/utime.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef __DJGPP__
|
|
||||||
#include <dir.h>
|
|
||||||
#include <utime.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
#include "doomstat.h"
|
#include "doomstat.h"
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#if defined (_WIN32) || defined (__DJGPP__)
|
#ifdef _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -54,17 +54,6 @@ typedef long ssize_t;
|
||||||
#define PDWORD_PTR PDWORD
|
#define PDWORD_PTR PDWORD
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#elif defined (__DJGPP__)
|
|
||||||
#define UINT8 unsigned char
|
|
||||||
#define SINT8 signed char
|
|
||||||
|
|
||||||
#define UINT16 unsigned short int
|
|
||||||
#define INT16 signed short int
|
|
||||||
|
|
||||||
#define INT32 signed long
|
|
||||||
#define UINT32 unsigned long
|
|
||||||
#define INT64 signed long long
|
|
||||||
#define UINT64 unsigned long long
|
|
||||||
#else
|
#else
|
||||||
#define __STDC_LIMIT_MACROS
|
#define __STDC_LIMIT_MACROS
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -136,7 +125,7 @@ char *strcasestr(const char *in, const char *what);
|
||||||
#endif
|
#endif
|
||||||
#endif //macintosh
|
#endif //macintosh
|
||||||
|
|
||||||
#if defined (PC_DOS) || defined (_WIN32) || defined (__HAIKU__)
|
#if defined (_WIN32) || defined (__HAIKU__)
|
||||||
#define HAVE_DOSSTR_FUNCS
|
#define HAVE_DOSSTR_FUNCS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#else
|
#else
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#endif
|
#endif
|
||||||
#elif !defined (__DJGPP__)
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
106
src/i_tcp.c
106
src/i_tcp.c
|
@ -107,15 +107,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif // USE_WINSOCK
|
#endif // USE_WINSOCK
|
||||||
|
|
||||||
#ifdef __DJGPP__
|
|
||||||
#ifdef WATTCP // Alam_GBC: Wattcp may need this
|
|
||||||
#include <tcp.h>
|
|
||||||
#define strerror strerror_s
|
|
||||||
#else // wattcp
|
|
||||||
#include <lsck/lsck.h>
|
|
||||||
#endif // libsocket
|
|
||||||
#endif // djgpp
|
|
||||||
|
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
struct sockaddr any;
|
struct sockaddr any;
|
||||||
|
@ -149,25 +140,15 @@
|
||||||
|
|
||||||
#include "doomstat.h"
|
#include "doomstat.h"
|
||||||
|
|
||||||
// win32 or djgpp
|
// win32
|
||||||
#if defined (USE_WINSOCK) || defined (__DJGPP__)
|
#ifdef USE_WINSOCK
|
||||||
// winsock stuff (in winsock a socket is not a file)
|
// winsock stuff (in winsock a socket is not a file)
|
||||||
#define ioctl ioctlsocket
|
#define ioctl ioctlsocket
|
||||||
#define close closesocket
|
#define close closesocket
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "i_addrinfo.h"
|
#include "i_addrinfo.h"
|
||||||
|
|
||||||
#ifdef __DJGPP__
|
|
||||||
|
|
||||||
#ifdef WATTCP
|
|
||||||
#define SELECTTEST
|
#define SELECTTEST
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define SELECTTEST
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DEFAULTPORT "5029"
|
#define DEFAULTPORT "5029"
|
||||||
|
|
||||||
#if defined (USE_WINSOCK) && !defined (NONET)
|
#if defined (USE_WINSOCK) && !defined (NONET)
|
||||||
|
@ -184,7 +165,7 @@
|
||||||
|
|
||||||
#ifndef NONET
|
#ifndef NONET
|
||||||
// define socklen_t in DOS/Windows if it is not already defined
|
// define socklen_t in DOS/Windows if it is not already defined
|
||||||
#if (defined (WATTCP) && !defined (__libsocket_socklen_t)) || defined (USE_WINSOCK1)
|
#ifdef USE_WINSOCK1
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#endif
|
#endif
|
||||||
static SOCKET_TYPE mysockets[MAXNETNODES+1] = {ERRSOCKET};
|
static SOCKET_TYPE mysockets[MAXNETNODES+1] = {ERRSOCKET};
|
||||||
|
@ -207,19 +188,6 @@ static const char *serverport_name = DEFAULTPORT;
|
||||||
static const char *clientport_name;/* any port */
|
static const char *clientport_name;/* any port */
|
||||||
|
|
||||||
#ifndef NONET
|
#ifndef NONET
|
||||||
|
|
||||||
#ifdef WATTCP
|
|
||||||
static void wattcp_outch(char s)
|
|
||||||
{
|
|
||||||
static char old = '\0';
|
|
||||||
char pr[2] = {s,0};
|
|
||||||
if (s == old && old == ' ') return;
|
|
||||||
else old = s;
|
|
||||||
if (s == '\r') CONS_Printf("\n");
|
|
||||||
else if (s != '\n') CONS_Printf(pr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_WINSOCK
|
#ifdef USE_WINSOCK
|
||||||
// stupid microsoft makes things complicated
|
// stupid microsoft makes things complicated
|
||||||
static char *get_WSAErrorStr(int e)
|
static char *get_WSAErrorStr(int e)
|
||||||
|
@ -764,11 +732,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
|
||||||
int opt;
|
int opt;
|
||||||
socklen_t opts;
|
socklen_t opts;
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
#ifdef WATTCP
|
|
||||||
char trueval = true;
|
|
||||||
#else
|
|
||||||
unsigned long trueval = true;
|
unsigned long trueval = true;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
mysockaddr_t straddr;
|
mysockaddr_t straddr;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
|
@ -1138,61 +1102,7 @@ boolean I_InitTcpDriver(void)
|
||||||
CONS_Debug(DBG_NETPLAY, "WinSock description: %s\n",WSAData.szDescription);
|
CONS_Debug(DBG_NETPLAY, "WinSock description: %s\n",WSAData.szDescription);
|
||||||
CONS_Debug(DBG_NETPLAY, "WinSock System Status: %s\n",WSAData.szSystemStatus);
|
CONS_Debug(DBG_NETPLAY, "WinSock System Status: %s\n",WSAData.szSystemStatus);
|
||||||
#endif
|
#endif
|
||||||
#ifdef __DJGPP__
|
|
||||||
#ifdef WATTCP // Alam_GBC: survive bootp, dhcp, rarp and wattcp/pktdrv from failing to load
|
|
||||||
survive_eth = 1; // would be needed to not exit if pkt_eth_init() fails
|
|
||||||
survive_bootp = 1; // ditto for BOOTP
|
|
||||||
survive_dhcp = 1; // ditto for DHCP/RARP
|
|
||||||
survive_rarp = 1;
|
|
||||||
//_watt_do_exit = false;
|
|
||||||
//_watt_handle_cbreak = false;
|
|
||||||
//_watt_no_config = true;
|
|
||||||
_outch = wattcp_outch;
|
|
||||||
init_misc();
|
|
||||||
//#ifdef DEBUGFILE
|
|
||||||
dbug_init();
|
|
||||||
//#endif
|
|
||||||
switch (sock_init())
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
init_tcp_driver = true;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
CONS_Debug(DBG_NETPLAY, "No packet driver detected\n");
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
CONS_Debug(DBG_NETPLAY, "Error while talking to packet driver\n");
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
CONS_Debug(DBG_NETPLAY, "BOOTP failed\n");
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
CONS_Debug(DBG_NETPLAY, "DHCP failed\n");
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
CONS_Debug(DBG_NETPLAY, "RARP failed\n");
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
CONS_Debug(DBG_NETPLAY, "TCP/IP failed\n");
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
CONS_Debug(DBG_NETPLAY, "PPPoE login/discovery failed\n");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
CONS_Debug(DBG_NETPLAY, "Unknown error with TCP/IP stack\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
hires_timer(0);
|
|
||||||
#else // wattcp
|
|
||||||
if (__lsck_init())
|
|
||||||
init_tcp_driver = true;
|
|
||||||
else
|
|
||||||
CONS_Debug(DBG_NETPLAY, "No TCP/IP driver detected\n");
|
|
||||||
#endif // libsocket
|
|
||||||
#endif // __DJGPP__
|
|
||||||
#ifndef __DJGPP__
|
|
||||||
init_tcp_driver = true;
|
init_tcp_driver = true;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!tcp_was_up && init_tcp_driver)
|
if (!tcp_was_up && init_tcp_driver)
|
||||||
|
@ -1217,10 +1127,8 @@ static void SOCK_CloseSocket(void)
|
||||||
if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET
|
if (mysockets[i] != (SOCKET_TYPE)ERRSOCKET
|
||||||
&& FD_ISSET(mysockets[i], &masterset))
|
&& FD_ISSET(mysockets[i], &masterset))
|
||||||
{
|
{
|
||||||
#if !defined (__DJGPP__) || defined (WATTCP)
|
|
||||||
FD_CLR(mysockets[i], &masterset);
|
FD_CLR(mysockets[i], &masterset);
|
||||||
close(mysockets[i]);
|
close(mysockets[i]);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
mysockets[i] = ERRSOCKET;
|
mysockets[i] = ERRSOCKET;
|
||||||
}
|
}
|
||||||
|
@ -1237,14 +1145,6 @@ void I_ShutdownTcpDriver(void)
|
||||||
WS_addrinfocleanup();
|
WS_addrinfocleanup();
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
#ifdef __DJGPP__
|
|
||||||
#ifdef WATTCP // wattcp
|
|
||||||
//_outch = NULL;
|
|
||||||
sock_exit();
|
|
||||||
#else
|
|
||||||
__lsck_uninit();
|
|
||||||
#endif // libsocket
|
|
||||||
#endif // __DJGPP__
|
|
||||||
CONS_Printf("shut down\n");
|
CONS_Printf("shut down\n");
|
||||||
init_tcp_driver = false;
|
init_tcp_driver = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -71,7 +71,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FloatToFixed(float f)
|
||||||
value [eax] \
|
value [eax] \
|
||||||
modify exact [eax edx]
|
modify exact [eax edx]
|
||||||
#elif defined (__GNUC__) && defined (__i386__) && !defined (NOASM)
|
#elif defined (__GNUC__) && defined (__i386__) && !defined (NOASM)
|
||||||
// DJGPP, i386 linux, cygwin or mingw
|
// i386 linux, cygwin or mingw
|
||||||
FUNCMATH FUNCINLINE static inline fixed_t FixedMul(fixed_t a, fixed_t b) // asm
|
FUNCMATH FUNCINLINE static inline fixed_t FixedMul(fixed_t a, fixed_t b) // asm
|
||||||
{
|
{
|
||||||
fixed_t ret;
|
fixed_t ret;
|
||||||
|
|
|
@ -64,8 +64,6 @@ typedef off_t off64_t;
|
||||||
#define PRIdS "u"
|
#define PRIdS "u"
|
||||||
#elif defined (_WIN32)
|
#elif defined (_WIN32)
|
||||||
#define PRIdS "Iu"
|
#define PRIdS "Iu"
|
||||||
#elif defined (DJGPP)
|
|
||||||
#define PRIdS "u"
|
|
||||||
#else
|
#else
|
||||||
#define PRIdS "zu"
|
#define PRIdS "zu"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1033,11 +1033,9 @@ void S_SetSfxVolume(INT32 volume)
|
||||||
|
|
||||||
void S_ClearSfx(void)
|
void S_ClearSfx(void)
|
||||||
{
|
{
|
||||||
#ifndef DJGPPDOS
|
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 1; i < NUMSFX; i++)
|
for (i = 1; i < NUMSFX; i++)
|
||||||
I_FreeSfx(S_sfx + i);
|
I_FreeSfx(S_sfx + i);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void S_StopChannel(INT32 cnum)
|
static void S_StopChannel(INT32 cnum)
|
||||||
|
|
Loading…
Reference in a new issue