Changeset 312 in Main for trunk/Server
- Timestamp:
- Oct 14, 2024, 3:17:37 AM (5 weeks ago)
- Location:
- trunk/Server
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/config.c
r311 r312 3 3 #define SOURCE 4 4 5 #include "tw_config.h" 6 #include "tw_module.h" 5 #include "../config.h" 7 6 8 7 #include <stdio.h> … … 16 15 #endif 17 16 18 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) )17 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__WATCOMC__)) 19 18 #ifdef USE_WINSOCK1 20 19 #include <winsock.h> … … 26 25 #include <cm_string.h> 27 26 #include <cm_log.h> 27 28 #ifdef __OS2__ 29 #include <types.h> 30 #include <netinet/in.h> 31 #include <tcpustd.h> 32 #endif 33 34 #include "tw_config.h" 35 #include "tw_module.h" 28 36 29 37 struct tw_config config; -
trunk/Server/http.c
r294 r312 16 16 #include <string.h> 17 17 18 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 18 #ifdef __OS2__ 19 #include <sys/time.h> 20 #include <types.h> 21 #include <tcpustd.h> 22 #endif 23 24 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__)) 19 25 #ifdef USE_WINSOCK1 20 26 #include <winsock.h> -
trunk/Server/main.c
r311 r312 22 22 #ifndef NO_SSL 23 23 #include <openssl/opensslv.h> 24 #endif 25 26 #ifdef __OS2__ 27 #include <types.h> 24 28 #endif 25 29 … … 802 806 signal(SIGCHLD, SIG_IGN); 803 807 signal(SIGPIPE, SIG_IGN); 804 #elif !defined(BUILD_GUI) 808 #elif !defined(BUILD_GUI) && !defined(__OS2__) 805 809 SetConsoleTitle(tw_server); 806 810 #endif -
trunk/Server/module.c
r219 r312 28 28 29 29 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 30 #ifdef __OS2__ 31 #define INCL_DOSMODULEMGR 32 #include <os2.h> 33 #else 30 34 #include <windows.h> 31 35 #include <direct.h> 36 #endif 32 37 #else 33 38 #include <dlfcn.h> … … 37 42 char* p = getcwd(NULL, 0); 38 43 void* lib; 44 char tmp[512]; 45 unsigned long l; 39 46 chdir(config.server_root); 40 47 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 48 #ifdef __OS2__ 49 lib = NULL; 50 l = (unsigned long)lib; 51 DosLoadModule(tmp, 512, path, &l); 52 #else 41 53 lib = LoadLibraryA(path); 54 #endif 42 55 #else 43 56 lib = dlopen(path, RTLD_LAZY); … … 53 66 void* tw_module_symbol(void* mod, const char* sym) { 54 67 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 68 #ifdef __OS2__ 69 void* ret; 70 DosQueryProcAddr((unsigned long)mod, 0, sym, (PFN*)&ret); 71 return ret; 72 #else 55 73 return GetProcAddress(mod, sym); 74 #endif 56 75 #else 57 76 return dlsym(mod, sym); -
trunk/Server/server.c
r311 r312 19 19 #include <unistd.h> 20 20 #endif 21 #include <ctype.h> 21 22 #include <string.h> 22 23 #include <stdbool.h> … … 33 34 #include <cm_dir.h> 34 35 36 #ifdef __OS2__ 37 #include <types.h> 38 #include <sys/time.h> 39 #define INCL_DOSPROCESS 40 #include <os2.h> 41 #include <process.h> 42 #define HANDLE void* 43 44 #include "strptime.h" 45 typedef int socklen_t; 46 47 #include <tcpustd.h> 48 #endif 49 35 50 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__)) 36 51 #ifndef NO_GETNAMEINFO … … 109 124 } else if(*pw == '*') { 110 125 return *(pw + 1) == 0 || tw_wildcard_match(pw, pt + 1) || tw_wildcard_match(pw + 1, pt); 111 } else if(*pw == '?' || ( *pw == *pt)) {126 } else if(*pw == '?' || (tolower(*pw) == tolower(*pt))) { 112 127 pw++; 113 128 pt++; … … 120 135 121 136 void close_socket(int sock) { 122 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 137 #ifdef __OS2__ 138 soclose(sock); 139 #elif defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 123 140 closesocket(sock); 124 141 #else … … 129 146 int tw_server_init(void) { 130 147 int i; 131 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)148 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__)) 132 149 WSADATA wsa; 133 150 #ifdef USE_WINSOCK1 … … 136 153 WSAStartup(MAKEWORD(2, 0), &wsa); 137 154 #endif 155 #endif 156 #ifdef __OS2__ 157 sock_init(); 138 158 #endif 139 159 for(i = 0; config.ports[i] != -1; i++) … … 1020 1040 #endif 1021 1041 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 1042 #ifdef __OS2__ 1043 _beginthread(tw_server_pass, 0, 0, e); 1044 #else 1022 1045 _beginthread(tw_server_pass, 0, e); 1046 #endif 1023 1047 #elif defined(_PSP) || defined(__PPU__) 1024 1048 tw_server_pass(e); -
trunk/Server/strptime.c
r243 r312 463 463 continue; 464 464 } 465 #if def _WIN32465 #if defined(_WIN32) || defined(__OS2__) 466 466 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) 467 467 if (1) -
trunk/Server/strptime.h
r189 r312 8 8 #include <time.h> 9 9 10 #if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) 10 #if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__) || defined(__OS2__) 11 11 char* strptime(const char *buf, const char *fmt, struct tm *tm); 12 12 #endif -
trunk/Server/tw_config.h
r311 r312 26 26 #include <net/net.h> 27 27 #endif 28 #if !defined(__OS2__) 28 29 #include <netinet/in.h> 30 #endif 29 31 #ifdef __HAIKU__ 30 32 #define NO_IPV6 … … 32 34 #endif 33 35 34 #if def NO_IPV636 #if defined(NO_IPV6) 35 37 #define SOCKADDR struct sockaddr_in 36 38 #else -
trunk/Server/version.c
r305 r312 16 16 #elif defined(__linux__) 17 17 "Linux" 18 #elif defined(__OS2__) 19 "OS/2" 18 20 #elif defined(__MINGW32__) 19 21 "Windows-MinGW32"
Note:
See TracChangeset
for help on using the changeset viewer.