Index: trunk/Platform/dos.mk
===================================================================
--- trunk/Platform/dos.mk	(revision 359)
+++ trunk/Platform/dos.mk	(revision 359)
@@ -0,0 +1,16 @@
+# $Id$
+
+PREFIX = C:/Tewi
+
+PLATFORM_IDENT = DOS_WATCOM
+CC = owcc
+AR = wlib
+AR_FLAGS = -q -b -n -fo
+CFLAGS = -b dos4g$(END) -I $(WATCOM)/h -I $(PWD)/watt32/inc -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -fPIC
+LDFLAGS = -b dos4g$(END)
+LIBS = $(PWD)/watt32/lib/wattcpwf.lib
+EXEC = .exe
+STATIC = lib
+LIBSUF = .dll
+OBJ = obj
+MODULE=
Index: trunk/README
===================================================================
--- trunk/README	(revision 358)
+++ trunk/README	(revision 359)
@@ -47,4 +47,5 @@
 UnixWare                 Working on 7.1.1
 OS/2                     Working
+DOS                      Working, missing module support and multi-threading
 NeXTSTEP                 Working, missing module support
 PlayStation Portable     Working, missing module support
Index: trunk/README.tmpl
===================================================================
--- trunk/README.tmpl	(revision 358)
+++ trunk/README.tmpl	(revision 359)
@@ -47,4 +47,5 @@
 UnixWare                 Working on 7.1.1
 OS/2                     Working
+DOS                      Working, missing module support and multi-threading
 NeXTSTEP                 Working, missing module support
 PlayStation Portable     Working, missing module support
Index: trunk/Server/config.c
===================================================================
--- trunk/Server/config.c	(revision 358)
+++ trunk/Server/config.c	(revision 359)
@@ -15,5 +15,5 @@
 #endif
 
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
 #ifdef USE_WINSOCK1
 #include <winsock.h>
Index: trunk/Server/http.c
===================================================================
--- trunk/Server/http.c	(revision 358)
+++ trunk/Server/http.c	(revision 359)
@@ -22,5 +22,5 @@
 #endif
 
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
 #ifdef USE_WINSOCK1
 #include <winsock.h>
Index: trunk/Server/main.c
===================================================================
--- trunk/Server/main.c	(revision 358)
+++ trunk/Server/main.c	(revision 359)
@@ -28,4 +28,8 @@
 #endif
 
+#ifdef __DOS__
+#include <tcp.h>
+#endif
+
 #include <cm_log.h>
 #include <cm_string.h>
@@ -35,5 +39,5 @@
 #include "tw_version.h"
 
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
 #include <windows.h>
 #elif defined(__NETWARE__)
@@ -94,5 +98,5 @@
 int startup(int argc, char** argv);
 
-#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) || defined(__BORLANDC__)
+#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__)) || defined(__BORLANDC__)
 char* get_registry(const char* main, const char* sub) {
 	DWORD bufsize = 512;
@@ -751,5 +755,5 @@
 	int i;
 	char* r;
-#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) || defined(__BORLANDC__)
+#if defined(__MINGW32__) || defined(_MSC_VER) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__)) || defined(__BORLANDC__)
 	char* confpath = cm_strdup(PREFIX "/etc/tewi.conf");
 	char* regpath = get_registry("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Tewi HTTPd", "InstallDir");
@@ -824,4 +828,7 @@
 		return 1;
 	}
+#ifdef __DOS__
+	sock_init();
+#endif
 	if(tw_server_init() != 0) {
 		STDERR_LOG("Could not initialize the server\n");
@@ -835,5 +842,5 @@
 	signal(SIGCHLD, SIG_IGN);
 	signal(SIGPIPE, SIG_IGN);
-#elif !defined(BUILD_GUI) && !defined(__OS2__) && !defined(__NETWARE__)
+#elif !defined(BUILD_GUI) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__)
 	SetConsoleTitle(tw_server);
 #endif
Index: trunk/Server/module.c
===================================================================
--- trunk/Server/module.c	(revision 358)
+++ trunk/Server/module.c	(revision 359)
@@ -18,5 +18,5 @@
 extern struct tw_config config;
 
-#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(__NeXT__)
+#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(__NeXT__) || defined(__DOS__)
 void* tw_module_load(const char* path) { return NULL; }
 
Index: trunk/Server/server.c
===================================================================
--- trunk/Server/server.c	(revision 358)
+++ trunk/Server/server.c	(revision 359)
@@ -48,5 +48,5 @@
 #endif
 
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
 #ifndef NO_GETNAMEINFO
 #include <ws2tcpip.h>
@@ -71,4 +71,11 @@
 #include "strptime.h"
 typedef int socklen_t;
+#elif defined(__DOS__)
+#include <netinet/tcp.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/select.h>
+
+#include "strptime.h"
 #else
 #ifdef USE_POLL
@@ -167,5 +174,5 @@
 int tw_server_init(void) {
 	int i;
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
 	WSADATA wsa;
 #ifdef USE_WINSOCK1
@@ -965,4 +972,5 @@
 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
 #ifdef __NETWARE__
+#elif defined(__DOS__)
 #else
 	_endthread();
@@ -987,4 +995,5 @@
 #elif defined(__NETWARE__)
 	int thread;
+#elif defined(__DOS__)
 #else
 	HANDLE handle;
@@ -1075,4 +1084,6 @@
 					_beginthread(tw_server_pass, 0, 0, e);
 #elif defined(__NETWARE__)
+					tw_server_pass(e);
+#elif defined(__DOS__)
 					tw_server_pass(e);
 #else
Index: trunk/Server/strptime.c
===================================================================
--- trunk/Server/strptime.c	(revision 358)
+++ trunk/Server/strptime.c	(revision 359)
@@ -470,5 +470,5 @@
                     continue;
                 }
-#if defined(_WIN32) || defined(__OS2__) || defined(__NeXT__)
+#if defined(_WIN32) || defined(__OS2__) || defined(__NeXT__) || defined(__DOS__)
 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__NeXT__)
 		if (1)
Index: trunk/Server/strptime.h
===================================================================
--- trunk/Server/strptime.h	(revision 358)
+++ trunk/Server/strptime.h	(revision 359)
@@ -8,5 +8,5 @@
 #include <time.h>
 
-#if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) || defined(__NETWARE__) || defined(__NeXT__)
+#if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) || defined(__NETWARE__) || defined(__NeXT__) || defined(__DOS__)
 char* strptime(const char *buf, const char *fmt, struct tm *tm);
 #endif
Index: trunk/Server/tw_config.h
===================================================================
--- trunk/Server/tw_config.h	(revision 358)
+++ trunk/Server/tw_config.h	(revision 359)
@@ -18,5 +18,5 @@
 #endif
 
-#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__))
 #ifdef USE_WINSOCK1
 #include <winsock.h>
Index: trunk/Server/version.c
===================================================================
--- trunk/Server/version.c	(revision 358)
+++ trunk/Server/version.c	(revision 359)
@@ -22,4 +22,6 @@
 #elif defined(__NETWARE__)
     "NetWare"
+#elif defined(__DOS__)
+    "DOS"
 #elif defined(__MINGW32__)
     "Windows-MinGW32"
Index: trunk/config_platform.h
===================================================================
--- trunk/config_platform.h	(revision 358)
+++ trunk/config_platform.h	(revision 359)
@@ -70,4 +70,8 @@
 #endif
 
+#if defined(__WATCOMC__) && defined(__DOS__) && !defined(NO_IPV6)
+#define NO_IPV6
+#endif
+
 #if defined(__NeXT__) && !defined(NO_IPV6)
 #define NO_IPV6
