diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 5e6f5ec12a..82bc03a4fd 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -243,6 +243,9 @@ qt_config_compile_test(getentropy LABEL "getentropy()" CODE "#include +#if __has_include() +# include +#endif int main(void) { diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index eb7eca6388..eb9aa542d3 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -53,7 +53,9 @@ # include #endif -#if !QT_CONFIG(getentropy) && (!defined(Q_OS_BSD4) || defined(__GLIBC__)) && !defined(Q_OS_WIN) +#if QT_CONFIG(getentropy) && __has_include() +# include +#elif !QT_CONFIG(getentropy) && (!defined(Q_OS_BSD4) || defined(__GLIBC__)) && !defined(Q_OS_WIN) # include "qdeadlinetimer.h" # include "qhashfunctions.h" #endif // !QT_CONFIG(getentropy)