Changeset 219 in Main for trunk/Server/server.c
- Timestamp:
- Oct 3, 2024, 5:40:37 AM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/server.c
r216 r219 33 33 #include <cm_dir.h> 34 34 35 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) 35 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 36 36 #ifndef NO_GETADDRINFO 37 37 #include <ws2tcpip.h> … … 85 85 int sockets[MAX_PORTS]; 86 86 87 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) 87 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 88 88 const char* reserved_names[] = {"CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; 89 89 #endif … … 112 112 113 113 void close_socket(int sock) { 114 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) 114 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 115 115 closesocket(sock); 116 116 #else … … 121 121 int tw_server_init(void) { 122 122 int i; 123 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) 123 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 124 124 WSADATA wsa; 125 125 WSAStartup(MAKEWORD(2, 0), &wsa); … … 450 450 }; 451 451 452 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) 452 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 453 453 #define NO_RETURN_THREAD 454 454 void tw_server_pass(void* ptr) { … … 458 458 int tw_server_pass(void* ptr) { 459 459 #endif 460 #if defined(__HAIKU__) || defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) 460 #if defined(__HAIKU__) || defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 461 461 #define FREE_PTR 462 462 int sock = ((struct pass_entry*)ptr)->sock; … … 552 552 struct tm* btm; 553 553 strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm); 554 #if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) 554 #if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 555 555 t = 0; 556 556 btm = localtime(&t); … … 619 619 path = cm_strcat(vhost_entry->root == NULL ? "" : vhost_entry->root, req.path); 620 620 cm_log("Server", "Filesystem path is %s", path); 621 #if defined(_MSC_VER) || defined(__BORLANDC__) 621 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 622 622 for(i = strlen(path) - 1; i >= 0; i--) { 623 623 if(path[i] == '/') { … … 628 628 } 629 629 #endif 630 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) 630 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 631 631 rpath = cm_strdup(path); 632 632 for(i = strlen(rpath) - 1; i >= 0; i--) { … … 899 899 #endif 900 900 close_socket(sock); 901 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) 901 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 902 902 _endthread(); 903 903 #elif defined(__HAIKU__) … … 914 914 #endif 915 915 916 #if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) 916 #if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 917 917 struct thread_entry { 918 918 #ifdef __HAIKU__ … … 933 933 struct timeval tv; 934 934 #endif 935 #if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) 935 #if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 936 936 struct thread_entry threads[2048]; 937 937 for(i = 0; i < sizeof(threads) / sizeof(threads[0]); i++) { … … 964 964 #endif 965 965 if(ret == -1) { 966 #if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__) 966 #if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__) 967 967 cm_log("Server", "Select failure: %s", strerror(errno)); 968 968 #endif … … 988 988 socklen_t clen = sizeof(claddr); 989 989 int sock = accept(sockets[i], (struct sockaddr*)&claddr, &clen); 990 #if defined(__MINGW32__) || defined(__HAIKU__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) 990 #if defined(__MINGW32__) || defined(__HAIKU__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 991 991 int j; 992 992 struct pass_entry* e = malloc(sizeof(*e)); … … 1001 1001 e->addr = claddr; 1002 1002 #endif 1003 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) 1003 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 1004 1004 _beginthread(tw_server_pass, 0, e); 1005 1005 #elif defined(_PSP) || defined(__PPU__)
Note:
See TracChangeset
for help on using the changeset viewer.