MinGW Compile fix (#329)

* 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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dfe5724..24c1352 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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.
 #
diff --git a/programs/CMakeLists.txt b/programs/CMakeLists.txt
index 8cdff31..8e37266 100644
--- a/programs/CMakeLists.txt
+++ b/programs/CMakeLists.txt
@@ -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.
 #
@@ -56,12 +56,15 @@
 	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 ()
@@ -79,7 +82,7 @@
 # PROGRAMS
 #################################################
 
-set(check_programs
+list(APPEND check_programs
 	chargen_server_upcall.c
 	client.c
 	client_upcall.c
diff --git a/usrsctplib/CMakeLists.txt b/usrsctplib/CMakeLists.txt
index 917b750..5e86670 100644
--- a/usrsctplib/CMakeLists.txt
+++ b/usrsctplib/CMakeLists.txt
@@ -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.
 #
diff --git a/usrsctplib/netinet/sctp_pcb.h b/usrsctplib/netinet/sctp_pcb.h
index 1498efe..0e46374 100755
--- a/usrsctplib/netinet/sctp_pcb.h
+++ b/usrsctplib/netinet/sctp_pcb.h
@@ -320,7 +320,7 @@
 #endif
 #endif
 #ifdef INET
-#if defined(__Userspace_os_Windows)
+#if defined(__Userspace_os_Windows) && !defined(__MINGW32__)
 	SOCKET userspace_rawsctp;
 	SOCKET userspace_udpsctp;
 #else
@@ -331,7 +331,7 @@
 	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
diff --git a/usrsctplib/user_atomic.h b/usrsctplib/user_atomic.h
index 2e6db04..77ea77b 100755
--- a/usrsctplib/user_atomic.h
+++ b/usrsctplib/user_atomic.h
@@ -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