From 3f143096c8b3ebfbd67ec9ad95276cde0509de5d Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Mon, 20 Jun 2022 11:43:21 +0100 Subject: [PATCH] merge bitcoin#25422: globally define NOMINMAX when building with mingw-w64 --- configure.ac | 3 +++ src/compat.h | 3 --- src/fs.cpp | 3 --- src/qt/guiutil.cpp | 3 --- src/support/lockedpool.cpp | 3 --- src/util/system.cpp | 3 --- 6 files changed, 3 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index 61f58fd9a5..af682ac9c1 100644 --- a/configure.ac +++ b/configure.ac @@ -758,6 +758,9 @@ case $host in fi CORE_CPPFLAGS="$CORE_CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN" + dnl Prevent the definition of min/max macros. + dnl We always want to use the standard library. + CORE_CPPFLAGS="$CORE_CPPFLAGS -DNOMINMAX" dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against. dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override diff --git a/src/compat.h b/src/compat.h index e2f784b96f..7940d78103 100644 --- a/src/compat.h +++ b/src/compat.h @@ -11,9 +11,6 @@ #endif #ifdef WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif #ifdef FD_SETSIZE #undef FD_SETSIZE // prevent redefinition compiler warning #endif diff --git a/src/fs.cpp b/src/fs.cpp index 7e216099ad..03afb11ba4 100644 --- a/src/fs.cpp +++ b/src/fs.cpp @@ -11,9 +11,6 @@ #include #include #else -#ifndef NOMINMAX -#define NOMINMAX -#endif #include #include #include diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 84afe40bba..2574adee48 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -29,9 +29,6 @@ #include #ifdef WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif #include #include #include diff --git a/src/support/lockedpool.cpp b/src/support/lockedpool.cpp index 14ad4782d7..766e817a8a 100644 --- a/src/support/lockedpool.cpp +++ b/src/support/lockedpool.cpp @@ -10,9 +10,6 @@ #endif #ifdef WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif #include #else #include // for mmap diff --git a/src/util/system.cpp b/src/util/system.cpp index 84d633db09..563a7bf4b0 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -60,9 +60,6 @@ #pragma warning(disable:4717) #endif -#ifndef NOMINMAX -#define NOMINMAX -#endif #include #include /* for _commit */