Skip to content

Commit

Permalink
MinGW Compile fix (#329)
Browse files Browse the repository at this point in the history
* Added support for mingw64 (gcc 6.3.0)

* Fixed mingw32/64 issue

* be more verbose (#312)

* Improve and of ICMP messages on Windows.

When an ICMP message is received on Windows 10 for a UDP socket,
WSAECONNRESET is reported as an error. In this case, just read
again.

Thanks to nxrighthere for reporting the issue and helping to
nail it down.

This fixes #309.

* Fix broken links, Make URLs' protocols consistent (#315)

Two Links missed leading `http(s)://` and were broken.
All links to `tools.ietf.org` now consistently use https.

* Backport https://svnweb.freebsd.org/base?view=revision&revision=340783

* Improve input validation for the IPPROTO_SCTP level socket options
SCTP_CONNECT_X and SCTP_CONNECT_X_DELAYED.

* Allow sending on demand SCTP HEARTBEATS only in the ESTABLISHED state.

* Fix cross-build linux->mingw (#320)

* Fix compile error due to merge mistake.

* test commit

* Add MinGW and MinGW64 support

* MinGW support, polishing

* Sanitize non C-style comments

* Revert uint32_t casting for htonl

* Ignore wformat errors on GCC + MinGW platforms

* Fix compile errors for MinGW
- Set minimum Windows Version to Windows 7

* Addressed Michaels comments and improved verbosity
  • Loading branch information
weinrank authored and tuexen committed Jul 30, 2019
1 parent 0849bb6 commit 2718a59
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2015-2015 Oleg Alexeenkov
# Copyright (C) 2015-2018 Felix Weinrank
# Copyright (C) 2015-2019 Felix Weinrank
#
# All rights reserved.
#
Expand Down
13 changes: 8 additions & 5 deletions programs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2015-2015 Oleg Alexeenkov
# Copyright (C) 2015-2017 Felix Weinrank
# Copyright (C) 2015-2019 Felix Weinrank
#
# All rights reserved.
#
Expand Down Expand Up @@ -56,12 +56,15 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
add_definitions(-D__APPLE_USE_RFC_2292)
endif ()

if (MSYS)
message(STATUS "MSYS")
if (MSYS OR MINGW)
message(STATUS "MSYS / MINGW")
add_definitions(-D__USE_MINGW_ANSI_STDIO)
# 0x0601 = Windows 7 API
add_definitions(-DWINVER=0x0601)
add_definitions(-D_WIN32_WINNT=0x0601)

if (CMAKE_C_COMPILER_ID MATCHES "GNU")
message(STATUS "MYSYS + GCC")
message(STATUS "MSYS / MINGW + GCC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format")
endif ()
Expand All @@ -79,7 +82,7 @@ find_package(Threads)
# PROGRAMS
#################################################

set(check_programs
list(APPEND check_programs
chargen_server_upcall.c
client.c
client_upcall.c
Expand Down
2 changes: 1 addition & 1 deletion usrsctplib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2015-2015 Oleg Alexeenkov
# Copyright (C) 2015-2017 Felix Weinrank
# Copyright (C) 2015-2019 Felix Weinrank
#
# All rights reserved.
#
Expand Down
4 changes: 2 additions & 2 deletions usrsctplib/netinet/sctp_pcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ struct sctp_base_info {
#endif
#endif
#ifdef INET
#if defined(__Userspace_os_Windows)
#if defined(__Userspace_os_Windows) && !defined(__MINGW32__)
SOCKET userspace_rawsctp;
SOCKET userspace_udpsctp;
#else
Expand All @@ -331,7 +331,7 @@ struct sctp_base_info {
userland_thread_t recvthreadudp;
#endif
#ifdef INET6
#if defined(__Userspace_os_Windows)
#if defined(__Userspace_os_Windows) && !defined(__MINGW32__)
SOCKET userspace_rawsctp6;
SOCKET userspace_udpsctp6;
#else
Expand Down
2 changes: 0 additions & 2 deletions usrsctplib/user_atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@
}
#endif
#if defined(__Userspace_os_Windows)
#if !defined(__MINGW32__)
static void atomic_init(void) {} /* empty when we are not using atomic_mtx */
#endif
#else
static inline void atomic_init(void) {} /* empty when we are not using atomic_mtx */
#endif
Expand Down

0 comments on commit 2718a59

Please sign in to comment.