]> Git repositories of Nishi - tewi.git/commitdiff
fix windows
authorNishi <nishi@nishi.boats>
Wed, 2 Oct 2024 19:31:23 +0000 (19:31 +0000)
committerNishi <nishi@nishi.boats>
Wed, 2 Oct 2024 19:31:23 +0000 (19:31 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@216 8739d7e6-ffea-ec47-b151-bdff447c6205

Platform/win32-service.mk
Platform/win32.mk
Platform/win64-service.mk
Platform/win64.mk
Server/server.c
VC6Compat/stdint.h

index a27d0774a7ae5967ac0b012be0261b569f009136..751b6ba77727ed139d35f763c833d25b20675645 100644 (file)
@@ -9,5 +9,5 @@ CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -fPIC -DSERVICE -mw
 LDFLAGS = -mwindows
 LIBS = -lws2_32
 EXEC = .exe
-LIB = .dll
+LIBSUF = .dll
 PREOBJS = tewi.res
index d40fb64d38e8f7996f67b910063fc1271516390c..857d339dc6209b2313c9bc218623bd1dfdb8597e 100644 (file)
@@ -9,5 +9,5 @@ CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -fPIC
 LDFLAGS =
 LIBS = -lws2_32
 EXEC = .exe
-LIB = .dll
+LIBSUF = .dll
 PREOBJS = tewi.res
index 7e1093d8f6eecd41e705b712108d6ee807deb555..d52befce9d5f4918d80da91458f0ca02454a0759 100644 (file)
@@ -9,5 +9,5 @@ CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -fPIC -DSERVICE -mw
 LDFLAGS = -mwindows
 LIBS = -lws2_32
 EXEC = .exe
-LIB = .dll
+LIBSUF = .dll
 PREOBJS = tewi.res
index 187462ad4283eb5d51ecd5793146711bdb941efd..1d74ff94fcebd15820149fcd6f17b3bfee89cf1f 100644 (file)
@@ -9,5 +9,5 @@ CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -fPIC
 LDFLAGS =
 LIBS = -lws2_32
 EXEC = .exe
-LIB = .dll
+LIBSUF = .dll
 PREOBJS = tewi.res
index bc23a02913837cb3ecbb60430c816914b69dadaf..8111304629c1d65c643da56bd9bff72f95eed4f5 100644 (file)
@@ -42,6 +42,7 @@
 #include <windows.h>
 
 #include "strptime.h"
+typedef int socklen_t;
 #else
 #ifdef USE_POLL
 #ifdef __PPU__
@@ -448,9 +449,8 @@ struct pass_entry {
        SOCKADDR addr;
 };
 
-#if defined(__MINGW32__) || defined(_MSC_VER)
-unsigned int WINAPI tw_server_pass(void* ptr) {
-#elif defined(__BORLANDC__)
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
+#define NO_RETURN_THREAD
 void tw_server_pass(void* ptr) {
 #elif defined(__HAIKU__)
 int32_t tw_server_pass(void* ptr) {
@@ -464,6 +464,7 @@ int tw_server_pass(void* ptr) {
        int port = ((struct pass_entry*)ptr)->port;
        SOCKADDR addr = ((struct pass_entry*)ptr)->addr;
 #else
+#define NO_RETURN_THREAD
        void tw_server_pass(int sock, bool ssl, int port, SOCKADDR addr) {
 #endif
        SSL* s = NULL;
@@ -618,10 +619,10 @@ int tw_server_pass(void* ptr) {
                        path = cm_strcat(vhost_entry->root == NULL ? "" : vhost_entry->root, req.path);
                        cm_log("Server", "Filesystem path is %s", path);
 #if defined(_MSC_VER) || defined(__BORLANDC__)
-                       for(i = strlen(path) - 1; i >= 0; i--){
-                               if(path[i] == '/'){
+                       for(i = strlen(path) - 1; i >= 0; i--) {
+                               if(path[i] == '/') {
                                        path[i] = 0;
-                               }else{
+                               } else {
                                        break;
                                }
                        }
@@ -898,15 +899,11 @@ cleanup:
 #endif
        close_socket(sock);
 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
-       _endthread(
-#ifndef __BORLANDC__
-               0
-#endif
-       );
+       _endthread();
 #elif defined(__HAIKU__)
                exit_thread(0);
 #endif
-#ifndef __BORLANDC__
+#ifndef NO_RETURN_THREAD
        return 0;
 #endif
 }
index 2ea98f786a09ffff7ccea8b1d10d91f5dd841a3e..6cfba411edd0a22497de93e3a904926cc960ccbe 100644 (file)
@@ -9,7 +9,6 @@ typedef unsigned int uint32_t;
 typedef signed char int8_t;
 typedef signed short int16_t;
 typedef signed int int32_t;
-typedef int socklen_t;
 
 #define INT32_MAX 0x7fffffff