From 64af11ba800974ce26dd118c4c79d756b6e1c27c Mon Sep 17 00:00:00 2001
From: "Peter W. Draper" <p.w.draper@durham.ac.uk>
Date: Fri, 22 Mar 2019 13:04:57 +0000
Subject: [PATCH] Add hack to work around an undef of min() and max() in
 x86_64-pc-linux-gnu/bits/c++config.h for GCC 6 and above, only a problem when
 we build with g++

---
 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index fbf097976a..77f8a65c39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,10 @@ if test "x$ax_enable_debug" != "xno"; then
    AC_DEFINE([SWIFT_DEVELOP_MODE],1,[Enable developer code options])
 fi
 
+# C++ in GCC 6 and above has an issue with undefined the min() and max()
+# macros. This hack works around that.
+AC_DEFINE([_GLIBCXX_INCLUDE_NEXT_C_HEADERS],1,[Hack for min() and max() using g++ 6+])
+
 # Enable POSIX and platform extension preprocessor macros.
 AC_USE_SYSTEM_EXTENSIONS
 
-- 
GitLab