From 9dd2b1a0deb9b7d9cebc28d4135597929c59eae3 Mon Sep 17 00:00:00 2001 From: Nishi Date: Thu, 17 Oct 2024 00:37:10 +0000 Subject: [PATCH] works on netware git-svn-id: file:///raid/svn-personal/tewi/trunk@361 8739d7e6-ffea-ec47-b151-bdff447c6205 --- Koakumafile | 15 +++++++++++++++ Platform/netware.mk | 2 +- README | 2 +- README.tmpl | 2 +- Server/http.c | 1 + Server/main.c | 9 ++++++++- Server/server.c | 8 +++++--- 7 files changed, 32 insertions(+), 7 deletions(-) diff --git a/Koakumafile b/Koakumafile index 471a5ac..c3205db 100644 --- a/Koakumafile +++ b/Koakumafile @@ -51,6 +51,21 @@ proc run {project_name} { RunCommand "doas cp tewidist.zip /raid/f/g/tewi/os2/tewidistos2-[exec make get-version]-nossl.zip" RunCommand "doas cp tewidist.zip /raid/ftp/pub/tewi/os2/tewidistos2-[exec make get-version]-nossl.zip" return + } elseif { "$project_name" == "Tewi-NetWare" } { + set ::env(WATCOM) "/usr/watcom" + set ::env(NOVELLNDK) "/usr/novell/clib" + set ::env(PATH) "$::env(PATH):/usr/watcom/binl64" + RunCommand "rm -rf netware" + RunCommand "make PLATFORM=netware" + RunCommand "make PLATFORM=netware install DESTDIR=netware/" + cd netware/SYS: + RunCommand "zip -rv ../../tewidist.zip Tewi" + cd ../.. + RunCommand "doas mkdir -p /raid/f/g/tewi/netware" + RunCommand "doas mkdir -p /raid/ftp/pub/tewi/netware" + RunCommand "doas cp tewidist.zip /raid/f/g/tewi/netware/tewidistnw-[exec make get-version]-nossl.zip" + RunCommand "doas cp tewidist.zip /raid/ftp/pub/tewi/os2/tewidistnw-[exec make get-version]-nossl.zip" + return } elseif { "$project_name" == "Tewi-PSP" } { RunCommand "./psp.sh" RunCommand "doas mkdir -p /raid/f/g/tewi/psp" diff --git a/Platform/netware.mk b/Platform/netware.mk index ff2030f..1f6def1 100644 --- a/Platform/netware.mk +++ b/Platform/netware.mk @@ -6,7 +6,7 @@ PLATFORM_IDENT = NETWARE_WATCOM CC = owcc AR = wlib AR_FLAGS = -q -b -n -fo -CFLAGS = -b netware_clib_lite -I $(NOVELLNDK)/include -I $(NOVELLNDK)/include/nlm -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -I ../VC6Compat -fPIC -D__WATCOM_LFN__ -Duint64_t=uint32_t +CFLAGS = -b netware_clib_lite -I $(NOVELLNDK)/include -I $(NOVELLNDK)/include/nlm -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -I ../VC6Compat -fPIC -D__WATCOM_LFN__ -Duint64_t=uint32_t -DN_PLAT_NLM LDFLAGS = -b netware_clib_lite LIBS = EXEC = .nlm diff --git a/README b/README index f2cbcc7..0ed5f71 100644 --- a/README +++ b/README @@ -46,6 +46,7 @@ Haiku Working Minix Working UnixWare Working on 7.1.1 OS/2 Working +NetWare Working on 6.5 SP8 DOS Working, missing module support and multi-threading NeXTSTEP Working, missing module support PlayStation Portable Working, missing module support @@ -57,5 +58,4 @@ Not supported ----------------------- I sometimes check they do compile, but does not work: -NetWare Cannot run fopen somehow PlayStation 2 Does not boot diff --git a/README.tmpl b/README.tmpl index 0d15b56..fc7c0fd 100644 --- a/README.tmpl +++ b/README.tmpl @@ -46,6 +46,7 @@ Haiku Working Minix Working UnixWare Working on 7.1.1 OS/2 Working +NetWare Working on 6.5 SP8 DOS Working, missing module support and multi-threading NeXTSTEP Working, missing module support PlayStation Portable Working, missing module support @@ -57,5 +58,4 @@ Not supported ----------------------- I sometimes check they do compile, but does not work: -NetWare Cannot run fopen somehow PlayStation 2 Does not boot diff --git a/Server/http.c b/Server/http.c index 8357759..4cf46b8 100644 --- a/Server/http.c +++ b/Server/http.c @@ -28,6 +28,7 @@ #include #endif #elif defined(__NETWARE__) +#include #include #else #ifdef USE_POLL diff --git a/Server/main.c b/Server/main.c index b5c7000..9d22d6d 100644 --- a/Server/main.c +++ b/Server/main.c @@ -41,6 +41,9 @@ #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__) && !defined(__DOS__)) #include #elif defined(__NETWARE__) +#include +#include +#include #endif #ifdef _PSP @@ -548,9 +551,13 @@ int main(int argc, char** argv) { int st; #ifdef __NETWARE__ struct arg_struct* parg = malloc(sizeof(*parg)); + SetCurrentNameSpace(NW_NS_LONG); parg->argc = argc; parg->argv = argv; - thread_stuff(parg); + DestroyScreen(GetCurrentScreen()); + SetCurrentScreen(CreateScreen("Tewi Console", 0)); + BeginThread(thread_stuff, NULL, 0, parg); + ThreadSwitch(); return 0; } diff --git a/Server/server.c b/Server/server.c index 3ed89fe..7293090 100644 --- a/Server/server.c +++ b/Server/server.c @@ -63,13 +63,15 @@ typedef int socklen_t; #include "strptime.h" typedef int socklen_t; #elif defined(__NETWARE__) +#include #include #define IPPROTO_TCP 0 #define INADDR_ANY 0 -#define htons(x) x #include "strptime.h" typedef int socklen_t; + +uint16_t htons(uint16_t n) { return ((n >> 8) & 0xff) | ((n << 8) & 0xff00); } #elif defined(__DOS__) #include #include @@ -1010,7 +1012,7 @@ void tw_server_loop(void) { fd_set fdset; struct timeval tv; #endif -#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) +#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__NETWARE__)) struct thread_entry threads[2048]; for(i = 0; i < sizeof(threads) / sizeof(threads[0]); i++) { threads[i].used = false; @@ -1083,7 +1085,7 @@ void tw_server_loop(void) { #ifdef __OS2__ _beginthread(tw_server_pass, 0, 0, e); #elif defined(__NETWARE__) - tw_server_pass(e); + BeginThread(tw_server_pass, NULL, 0, e); #elif defined(__DOS__) tw_server_pass(e); #else -- 2.43.0