Changeset 219 in Main for trunk/Server/server.c


Ignore:
Timestamp:
Oct 3, 2024, 5:40:37 AM (6 weeks ago)
Author:
Nishi
Message:

add watcom

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/server.c

    r216 r219  
    3333#include <cm_dir.h>
    3434
    35 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     35#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    3636#ifndef NO_GETADDRINFO
    3737#include <ws2tcpip.h>
     
    8585int sockets[MAX_PORTS];
    8686
    87 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     87#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    8888const 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"};
    8989#endif
     
    112112
    113113void close_socket(int sock) {
    114 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     114#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    115115        closesocket(sock);
    116116#else
     
    121121int tw_server_init(void) {
    122122        int i;
    123 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     123#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    124124        WSADATA wsa;
    125125        WSAStartup(MAKEWORD(2, 0), &wsa);
     
    450450};
    451451
    452 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     452#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    453453#define NO_RETURN_THREAD
    454454void tw_server_pass(void* ptr) {
     
    458458int tw_server_pass(void* ptr) {
    459459#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__)
    461461#define FREE_PTR
    462462        int sock = ((struct pass_entry*)ptr)->sock;
     
    552552                                        struct tm* btm;
    553553                                        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__)
    555555                                        t = 0;
    556556                                        btm = localtime(&t);
     
    619619                        path = cm_strcat(vhost_entry->root == NULL ? "" : vhost_entry->root, req.path);
    620620                        cm_log("Server", "Filesystem path is %s", path);
    621 #if defined(_MSC_VER) || defined(__BORLANDC__)
     621#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    622622                        for(i = strlen(path) - 1; i >= 0; i--) {
    623623                                if(path[i] == '/') {
     
    628628                        }
    629629#endif
    630 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     630#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    631631                        rpath = cm_strdup(path);
    632632                        for(i = strlen(rpath) - 1; i >= 0; i--) {
     
    899899#endif
    900900        close_socket(sock);
    901 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     901#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    902902        _endthread();
    903903#elif defined(__HAIKU__)
     
    914914#endif
    915915
    916 #if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__)
     916#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    917917struct thread_entry {
    918918#ifdef __HAIKU__
     
    933933        struct timeval tv;
    934934#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__)
    936936        struct thread_entry threads[2048];
    937937        for(i = 0; i < sizeof(threads) / sizeof(threads[0]); i++) {
     
    964964#endif
    965965                if(ret == -1) {
    966 #if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__)
     966#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
    967967                        cm_log("Server", "Select failure: %s", strerror(errno));
    968968#endif
     
    988988                                        socklen_t clen = sizeof(claddr);
    989989                                        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__)
    991991                                        int j;
    992992                                        struct pass_entry* e = malloc(sizeof(*e));
     
    10011001                                        e->addr = claddr;
    10021002#endif
    1003 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     1003#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    10041004                                        _beginthread(tw_server_pass, 0, e);
    10051005#elif defined(_PSP) || defined(__PPU__)
Note: See TracChangeset for help on using the changeset viewer.