Changeset 240 in Main


Ignore:
Timestamp:
Oct 3, 2024, 2:54:55 PM (6 weeks ago)
Author:
Nishi
Message:

winsock1 support

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r217 r240  
    33PWD = `pwd`
    44PLATFORM = generic
     5PLATFORM_IDENT = NOT_WINDOWS
    56PREFIX = /usr/local
    67MODULE = ./Module
     
    2425
    2526./Server:: ./Common ./Tool/option ./Tool/genconf ./Tool/itworks
    26         $(MAKE) -C $@ $(FLAGS) EXTOBJS="`./Tool/option objs ../`" EXTLIBS="`./Tool/option libs ../`" EXTCFLAGS="`./Tool/option cflags ../`" EXTLDFLAGS="`./Tool/option ldflags ../`"
     27        $(MAKE) -C $@ $(FLAGS) EXTOBJS="`./Tool/option objs ../`" EXTLIBS="`./Tool/option libs ../ $(PLATFORM_IDENT)`" EXTCFLAGS="`./Tool/option cflags ../`" EXTLDFLAGS="`./Tool/option ldflags ../`"
    2728
    2829./Module:: ./Common
  • trunk/Platform/bcc.mk

    r215 r240  
    33PREFIX = C:/Tewi
    44
     5PLATFORM_IDENT = WINDOWS
    56CC = ../bcc.sh
    67AR = tlib
     
    910CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -fPIC
    1011LDFLAGS =
    11 LIBS = -lws2_32
     12LIBS =
    1213EXEC =
    1314STATIC = lib
  • trunk/Platform/vc6.mk

    r215 r240  
    33PREFIX = C:/Tewi
    44
     5PLATFORM_IDENT = WINDOWS
    56CC = ../vc6.sh
    67AR = lib
     
    89CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -fPIC
    910LDFLAGS =
    10 LIBS = -lws2_32 -ladvapi32 -llibcmt
     11LIBS = -ladvapi32 -llibcmt
    1112EXEC =
    1213STATIC = lib
  • trunk/Platform/watcom.mk

    r220 r240  
    33PREFIX = C:/Tewi
    44
     5PLATFORM_IDENT = WINDOWS_WATCOM
    56CC = owcc
    67AR = wlib
     
    89CFLAGS = -b nt$(END) -I $(WATCOM)/h/nt -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -fPIC
    910LDFLAGS = -b nt$(END)
    10 LIBS = ws2_32.lib
     11LIBS =
    1112EXEC = .exe
    1213STATIC = lib
  • trunk/Platform/win32-service.mk

    r216 r240  
    33PREFIX = C:/Tewi
    44
     5PLATFORM_IDENT = WINDOWS
    56CC = i686-w64-mingw32-gcc
    67AR = i686-w64-mingw32-ar
     
    89CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -fPIC -DSERVICE -mwindows
    910LDFLAGS = -mwindows
    10 LIBS = -lws2_32
     11LIBS =
    1112EXEC = .exe
    1213LIBSUF = .dll
  • trunk/Platform/win32.mk

    r216 r240  
    33PREFIX = C:/Tewi
    44
     5PLATFORM_IDENT = WINDOWS
    56CC = i686-w64-mingw32-gcc
    67AR = i686-w64-mingw32-ar
     
    89CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -fPIC
    910LDFLAGS =
    10 LIBS = -lws2_32
     11LIBS =
    1112EXEC = .exe
    1213LIBSUF = .dll
  • trunk/Platform/win64-service.mk

    r216 r240  
    33PREFIX = C:/Tewi
    44
     5PLATFORM_IDENT = WINDOWS
    56CC = x86_64-w64-mingw32-gcc
    67AR = x86_64-w64-mingw32-ar
     
    89CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -fPIC -DSERVICE -mwindows
    910LDFLAGS = -mwindows
    10 LIBS = -lws2_32
     11LIBS =
    1112EXEC = .exe
    1213LIBSUF = .dll
  • trunk/Platform/win64.mk

    r216 r240  
    33PREFIX = C:/Tewi
    44
     5PLATFORM_IDENT = WINDOWS
    56CC = x86_64-w64-mingw32-gcc
    67AR = x86_64-w64-mingw32-ar
     
    89CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -fPIC
    910LDFLAGS =
    10 LIBS = -lws2_32
     11LIBS =
    1112EXEC = .exe
    1213LIBSUF = .dll
  • trunk/Server/config.c

    r215 r240  
    1616
    1717#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
     18#ifdef USE_WINSOCK1
     19#include <winsock.h>
     20#else
    1821#include <winsock2.h>
     22#endif
    1923#endif
    2024
  • trunk/Server/http.c

    r219 r240  
    1717
    1818#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
     19#ifdef USE_WINSOCK1
     20#include <winsock.h>
     21#else
    1922#include <winsock2.h>
     23#endif
    2024#else
    2125#ifdef USE_POLL
  • trunk/Server/server.c

    r219 r240  
    3838#include <wspiapi.h>
    3939#endif
     40#ifdef USE_WINSOCK1
     41#include <winsock.h>
     42#else
    4043#include <winsock2.h>
     44#endif
    4145#include <process.h>
    4246#include <windows.h>
     
    123127#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
    124128        WSADATA wsa;
     129#ifdef USE_WINSOCK1
     130        WSAStartup(MAKEWORD(1, 1), &wsa);
     131#else
    125132        WSAStartup(MAKEWORD(2, 0), &wsa);
     133#endif
    126134#endif
    127135        for(i = 0; config.ports[i] != -1; i++)
  • trunk/Server/tw_config.h

    r219 r240  
    1616
    1717#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
     18#ifdef USE_WINSOCK1
     19#include <winsock.h>
     20#else
    1821#include <winsock2.h>
     22#endif
    1923#define NO_IPV6
    2024#else
  • trunk/Tool/option.c

    r168 r240  
    2727                printf("-lssl -lcrypto");
    2828#endif
     29                if(strcmp(argv[3], "WINDOWS") == 0){
     30#ifdef USE_WINSOCK1
     31                        printf(" -lwsock32");
     32#else
     33                        printf(" -lws2_32");
     34#endif
     35                }else if(strcmp(argv[3], "WINDOWS_WATCOM") == 0){
     36#ifdef USE_WINSOCK1
     37                        printf(" wsock32.lib");
     38#else
     39                        printf(" ws2_32.lib");
     40#endif
     41                }
    2942        }
    3043        printf("\n");
  • trunk/bcc.sh

    r226 r240  
    3232                options="$options -`echo "$i" | sed "s/^-//g"`"
    3333        elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then
    34                 libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib"
     34                if [ ! "$i" = "-lwsock32" ]; then
     35                        libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib"
     36                fi
    3537        elif [ "$dowhat" = "output" ]; then
    3638                dowhat=""
  • trunk/config.h.tmpl

    r219 r240  
    1111#define HAS_CHROOT
    1212#undef NO_GETADDRINFO
     13#undef USE_WINSOCK1
    1314
    1415/* DO NOT EDIT BELOW THIS LINE */
     
    2122#undef USE_POLL
    2223/* Force select(2) for Windows */
     24#endif
     25#if (defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)) && defined(USE_WINSOCK1) && !defined(NO_GETADDRINFO)
     26#define NO_GETADDRINFO
     27/* getaddrinfo is not on winsock 1 */
    2328#endif
    2429
Note: See TracChangeset for help on using the changeset viewer.