From: Chris Koeritz Date: Mon, 26 Sep 2016 20:22:42 +0000 (-0400) Subject: minor updates from windows, getting gnu windows to compile slightly further X-Git-Tag: 2.140.90~421 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=6356fdf6b5a4d7707975b6b2baa3cd075bec33dc;p=feisty_meow.git minor updates from windows, getting gnu windows to compile slightly further but we keep getting blocked by incompatibilities under cygwin. --- diff --git a/nucleus/applications/bundler/makefile b/nucleus/applications/bundler/makefile index 1137f980..7904ea71 100644 --- a/nucleus/applications/bundler/makefile +++ b/nucleus/applications/bundler/makefile @@ -11,12 +11,11 @@ endif DEFINITIONS += __BUILD_STATIC_APPLICATION__=t TARGETS = bundle_creator.exe LAST_TARGETS += make_stub -ifeq "$(OP_SYSTEM)" "WIN32" +ifeq "$(COMPILER)" "VISUAL_CPP" LOCAL_HEADERS += $(THIRD_PARTY_DIR)/zlib/include LOCAL_LIBRARIES += $(THIRD_PARTY_DIR)/zlib/lib LIBS_USED += zlib.lib -endif -ifeq "$(OP_SYSTEM)" "UNIX" +else LIBS_USED += z endif diff --git a/nucleus/applications/bundler/makefile.stub b/nucleus/applications/bundler/makefile.stub index 4ab4683e..a949d012 100644 --- a/nucleus/applications/bundler/makefile.stub +++ b/nucleus/applications/bundler/makefile.stub @@ -10,7 +10,8 @@ ifeq "$(OMIT_VERSIONS)" "" endif DEFINITIONS += __BUILD_STATIC_APPLICATION__=t TARGETS = unpacker_stub.exe -ifeq "$(OP_SYSTEM)" "WIN32" +#ifeq "$(OP_SYSTEM)" "WIN32" +ifeq "$(COMPILER)" "VISUAL_CPP" LIBS_USED += libcmt.lib shlwapi.lib zlib.lib LOAD_FLAG_PREFIX += -nodefaultlib:msvcrt.lib COMPILER_FLAGS += -MT diff --git a/nucleus/applications/bundler/unpacker_stub.cpp b/nucleus/applications/bundler/unpacker_stub.cpp index 8782e2d8..85872476 100644 --- a/nucleus/applications/bundler/unpacker_stub.cpp +++ b/nucleus/applications/bundler/unpacker_stub.cpp @@ -43,7 +43,7 @@ #ifdef __UNIX__ #include #endif -#ifdef __WIN32__ +#ifdef _MSC_VER #include #include #include diff --git a/nucleus/applications/utilities/makefile b/nucleus/applications/utilities/makefile index bb32d469..c3199848 100644 --- a/nucleus/applications/utilities/makefile +++ b/nucleus/applications/utilities/makefile @@ -7,7 +7,7 @@ TYPE = application ifeq "$(OMIT_VERSIONS)" "" SOURCE += util_version.rc endif -LOCAL_LIBS_USED = application basis configuration filesystem loggers mathematics nodes processes textual timely structures +LOCAL_LIBS_USED = application configuration filesystem loggers mathematics nodes processes textual timely structures basis TARGETS = await_app_exit.exe bytedump.exe checker.exe dirtree.exe ini_edit.exe mdate.exe \ splitter.exe time_set_effective_id.exe time_running_app.exe diff --git a/octopi/library/sockets/raw_socket.cpp b/octopi/library/sockets/raw_socket.cpp index 97ad00ab..5bc2a87e 100644 --- a/octopi/library/sockets/raw_socket.cpp +++ b/octopi/library/sockets/raw_socket.cpp @@ -126,7 +126,7 @@ int raw_socket::ioctl(basis::un_int socket, int request, void *argp) const return ::ioctl(socket, request, argp); #endif #ifdef __WIN32__ - return ioctlsocket(socket, request, (un_long *)argp); + return ioctlsocket(socket, request, (un_int *)argp); #endif } @@ -217,15 +217,23 @@ int raw_socket::inner_select(basis::un_int socket, int mode, int timeout, FD_ZERO(&write_list); FD_SET(socket, &write_list); FD_ZERO(&exceptions); FD_SET(socket, &exceptions); - timeval time_out; - time_stamp::fill_timeval_ms(time_out, timeout); + timeval base_time_out; + time_stamp::fill_timeval_ms(base_time_out, timeout); // timeval has tv_sec=seconds, tv_usec=microseconds. +#if !defined(__GNU_WINDOWS__) + timeval *time_out = &base_time_out; +#elif defined(__GNU_WINDOWS__) + __ms_timeval win_time_out; + win_time_out.tv_sec = base_time_out.tv_sec; + win_time_out.tv_usec = base_time_out.tv_usec; + __ms_timeval *time_out = &win_time_out; +#endif // select will tell us about the socket. int ret = ::select(socket + 1, (mode & SELECTING_JUST_WRITE)? NIL : &read_list, (mode & SELECTING_JUST_READ)? NIL : &write_list, - &exceptions, &time_out); + &exceptions, time_out); int error = critical_events::system_error(); if (!ret) return 0; // nothing to report. @@ -389,15 +397,23 @@ int raw_socket::select(int_array &read_sox, int_array &write_sox, FD_SET(sock, &write_list); } - timeval time_out; - time_stamp::fill_timeval_ms(time_out, timeout); + timeval base_time_out; + time_stamp::fill_timeval_ms(base_time_out, timeout); // timeval has tv_sec=seconds, tv_usec=microseconds. +#if !defined(__GNU_WINDOWS__) + timeval *time_out = &base_time_out; +#elif defined(__GNU_WINDOWS__) + __ms_timeval win_time_out; + win_time_out.tv_sec = base_time_out.tv_sec; + win_time_out.tv_usec = base_time_out.tv_usec; + __ms_timeval *time_out = &win_time_out; +#endif // select will tell us about the socket. int ret = ::select(highest + 1, (read_sox.length())? &read_list : NIL, (write_sox.length())? &write_list : NIL, - &exceptions, &time_out); + &exceptions, time_out); int error = critical_events::system_error(); if (ret == SOCKET_ERROR) { diff --git a/octopi/library/tests_sockets/makefile b/octopi/library/tests_sockets/makefile index 1dad659d..0d8a2cd2 100644 --- a/octopi/library/tests_sockets/makefile +++ b/octopi/library/tests_sockets/makefile @@ -8,9 +8,9 @@ TARGETS = test_address.exe test_bcast_spocket.exe test_enum_adapters.exe \ LOCAL_LIBS_USED = sockets unit_test application configuration loggers textual timely \ processes filesystem structures basis VCPP_USE_SOCK = t -ifeq "$(OP_SYSTEM)" "WIN32" - LIBS_USED += ws2_32.lib -endif +#ifeq "$(COMPILER)" "VISUAL_CPP" +# LIBS_USED += ws2_32.lib +#endif RUN_TARGETS = $(ACTUAL_TARGETS) include cpp/rules.def diff --git a/scripts/clam/cpp/rules.def b/scripts/clam/cpp/rules.def index b9db8446..1cfc6077 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -92,6 +92,8 @@ ifeq "$(COMPILER)" "GNU_WINDOWS" LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) ) endif +LOAD_FLAG_PREFIX += -lwsock32 -lmswsock -shared + ifneq "$(USE_CURL)" "" COMPILER_FLAGS += `curl-config --cflags` LOAD_FLAG_SUFFIX += `curl-config --libs` @@ -208,7 +210,7 @@ ifeq "$(COMPILER)" "VISUAL_CPP" ifneq "$(USE_CURL)" "" # # curl wants this win32 flag? -# DEFINITIONS += _WIN32 + DEFINITIONS += WIN32 LOCAL_HEADERS += $(THIRD_PARTY_DIR)/curl/include LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/curl/lib # LIBS_USED += libcurl.dll.a diff --git a/scripts/clam/cpp/variables.def b/scripts/clam/cpp/variables.def index fc161193..baa42e1f 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -72,8 +72,8 @@ ifeq "$(COMPILER)" "" endif endif ifeq "$(OP_SYSTEM)" "WIN32" - COMPILER := GNU_WINDOWS -# COMPILER := VISUAL_CPP +# COMPILER := GNU_WINDOWS + COMPILER := VISUAL_CPP endif ifeq "$(COMPILER)" "" # if we get into this case, we have no idea how to set the default