--- a/src/corelib/global/qglobal.cpp 2018-01-16 09:04:38.139206900 +0100 +++ b/src/corelib/global/qglobal.cpp 2018-01-16 09:06:33.592894000 +0100 @@ -2036,7 +2036,7 @@ } #endif -#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINRT) +#elif defined(Q_OS_WIN) || defined(Q_OS_WINRT) QT_BEGIN_INCLUDE_NAMESPACE #include "qt_windows.h" --- a/src/corelib/global/qsysinfo.h 2018-01-16 09:06:34.435144000 +0100 +++ b/src/corelib/global/qsysinfo.h 2018-01-16 09:07:01.351237000 +0100 @@ -212,7 +212,7 @@ QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED -#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) +#if defined(Q_OS_WIN) QT_SYSINFO_DEPRECATED_X("Use QOperatingSystemVersion::current()") static const WinVersion WindowsVersion; QT_SYSINFO_DEPRECATED_X("Use QOperatingSystemVersion::current()") static WinVersion windowsVersion(); #else --- a/src/corelib/global/qsystemdetection.h 2018-01-16 09:07:01.918150300 +0100 +++ b/src/corelib/global/qsystemdetection.h 2018-01-16 09:09:36.063195100 +0100 @@ -125,6 +125,7 @@ # define Q_OS_LINUX #elif defined(__CYGWIN__) # define Q_OS_CYGWIN +# define Q_OS_LINUX #elif !defined(SAG_COM) && (!defined(WINAPI_FAMILY) || WINAPI_FAMILY==WINAPI_FAMILY_DESKTOP_APP) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) # define Q_OS_WIN32 # define Q_OS_WIN64 --- a/src/corelib/plugin/qlibrary_unix.cpp 2018-01-16 09:09:36.452518500 +0100 +++ b/src/corelib/plugin/qlibrary_unix.cpp 2018-01-16 09:13:42.748165300 +0100 @@ -156,11 +156,9 @@ if (loadHints & QLibrary::ExportExternalSymbolsHint) { dlFlags |= RTLD_GLOBAL; } -#if !defined(Q_OS_CYGWIN) else { dlFlags |= RTLD_LOCAL; } -#endif #if defined(RTLD_DEEPBIND) if (loadHints & QLibrary::DeepBindHint) dlFlags |= RTLD_DEEPBIND; --- a/mkspecs/cygwin-g++/qplatformdefs.h 2018-01-16 11:13:33.714086100 +0100 +++ b/mkspecs/cygwin-g++/qplatformdefs.h 2018-01-16 11:16:19.157476700 +0100 @@ -53,6 +53,17 @@ # define _GNU_SOURCE #endif +// On Cygwin features.h is sometimes pre-included, and sets __GNU_VISIBLE to 0. +#if defined(__GNU_VISIBLE) +# if 0 == __GNU_VISIBLE +# undef __GNU_VISIBLE +# define __GNU_VISIBLE 1 +# endif +#else + // It is included too late in unistd.h +# include +#endif + #include --- a/src/corelib/global/qglobal_p.h 2018-01-16 11:27:57.978337700 +0100 +++ b/src/corelib/global/qglobal_p.h 2018-01-16 11:28:16.771486600 +0100 @@ -51,6 +51,7 @@ // We mean it. // +#include "qplatformdefs.h" #include "qglobal.h" #include "qglobal_p.h" // include self to avoid syncqt warning - no-op --- a/src/corelib/thread/qmutex_p.h 2017-11-16 06:15:28.000000000 +0100 +++ b/src/corelib/thread/qmutex_p.h 2018-01-16 11:42:39.013460000 +0100 @@ -61,8 +61,8 @@ #if defined(Q_OS_MAC) # include -#elif defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) -// use Linux mutexes everywhere except for LSB builds +#elif defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) && !defined(Q_OS_CYGWIN) +// use Linux mutexes everywhere except for LSB builds and Cygwin # define QT_LINUX_FUTEX #elif defined(Q_OS_UNIX) # if _POSIX_VERSION-0 >= 200112L || _XOPEN_VERSION-0 >= 600 --- a/src/corelib/thread/qthread_unix.cpp 2018-01-16 11:46:19.773498700 +0100 +++ b/src/corelib/thread/qthread_unix.cpp 2018-01-16 11:53:23.095107100 +0100 @@ -38,10 +38,10 @@ ** ****************************************************************************/ -#include "qthread.h" - #include "qplatformdefs.h" +#include "qthread.h" + #include #include @@ -92,7 +92,7 @@ # endif #endif -#if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) +#if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) && !defined(Q_OS_CYGWIN) #include #endif @@ -305,13 +305,13 @@ #if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX)) static void setCurrentThreadName(pthread_t threadId, const char *name) { -# if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) +# if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) && !defined(Q_OS_CYGWIN) Q_UNUSED(threadId); prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); # elif defined(Q_OS_MAC) Q_UNUSED(threadId); pthread_setname_np(name); -# elif defined(Q_OS_QNX) +# elif defined(Q_OS_QNX) || defined(Q_OS_CYGWIN) pthread_setname_np(threadId, name); # endif } --- a/src/corelib/io/qstorageinfo_unix.cpp 2018-01-16 12:13:08.368493200 +0100 +++ b/src/corelib/io/qstorageinfo_unix.cpp 2018-01-16 12:14:53.192484500 +0100 @@ -98,7 +98,7 @@ # define QT_STATFSBUF struct statvfs # define QT_STATFS ::statvfs #else -# if defined(QT_LARGEFILE_SUPPORT) +# if defined(QT_LARGEFILE_SUPPORT) && !defined(Q_OS_CYGWIN) # define QT_STATFSBUF struct statvfs64 # define QT_STATFS ::statvfs64 # else --- a/src/corelib/kernel/qelapsedtimer_unix.cpp 2018-01-16 12:17:40.738112300 +0100 +++ b/src/corelib/kernel/qelapsedtimer_unix.cpp 2018-01-16 12:18:07.249634400 +0100 @@ -38,6 +38,7 @@ ** ****************************************************************************/ +#include "qplatformdefs.h" #include "qelapsedtimer.h" #include "qdeadlinetimer.h" #include "qdeadlinetimer_p.h" --- a/src/corelib/io/qfilesystemwatcher.cpp 2018-01-16 12:23:11.293959600 +0100 +++ b/src/corelib/io/qfilesystemwatcher.cpp 2018-01-16 12:24:16.272620900 +0100 @@ -49,7 +49,7 @@ #include #include -#if defined(Q_OS_LINUX) || (defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY)) +#if (defined(Q_OS_LINUX) || (defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY))) && !defined(Q_OS_CYGWIN) #define USE_INOTIFY #endif --- a/src/corelib/global/qversiontagging.h 2018-01-16 12:36:27.372835100 +0100 +++ b/src/corelib/global/qversiontagging.h 2018-01-16 12:37:23.965761300 +0100 @@ -62,7 +62,7 @@ #if defined(QT_BUILD_CORE_LIB) || defined(QT_BOOTSTRAPPED) || defined(QT_NO_VERSION_TAGGING) || defined(QT_STATIC) // don't make tags in QtCore, bootstrapped systems or if the user asked not to -#elif defined(Q_CC_GNU) && !defined(Q_OS_ANDROID) +#elif defined(Q_CC_GNU) && !defined(Q_OS_ANDROID) && !defined(Q_OS_CYGWIN) # if defined(Q_PROCESSOR_X86) && (defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD_KERNEL)) # if defined(Q_PROCESSOR_X86_64) && QT_POINTER_SIZE == 8 // x86-64 64-bit # define QT_VERSION_TAG_RELOC(sym) ".quad " QT_STRINGIFY(QT_MANGLE_NAMESPACE(sym)) "@GOT\n"