From d30c9b0381fb82ee777eb5cd6890b59758c68fb4 Mon Sep 17 00:00:00 2001
From: Stephen Kelly <steveire@gmail.com>
Date: Thu, 1 Jan 2015 12:54:50 +0100
Subject: [PATCH] Workaround SolarisStudio bug with libstdc++.

Using iostream and cxxabi.h together causes a compile failure

 .../CC-gcc/include/c++/4.8.2/cxxabi.h", line 131: Error: Only one of a
 set of overloaded functions can be extern "C".

See https://community.oracle.com/thread/3644901 for details.

This only happens if the iostream include is before the cxxabi include.

The available solutions are: re-order the includes in
SystemInformation.cxx, skip the test for KWSYS_CXX_HAS_CXXABI, or cause
it to fail by adding the include.  Do the latter for now.

Change-Id: Ia1a6a6fca12eb9a42f4a4be5252f22fb6e74a318
---
 kwsysPlatformTestsCXX.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx
index 3f947f3..82620da 100644
--- a/kwsysPlatformTestsCXX.cxx
+++ b/kwsysPlatformTestsCXX.cxx
@@ -548,6 +548,10 @@ int main()
 #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
 # define _GNU_SOURCE
 #endif
+#if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 \
+     && __linux && __SUNPRO_CC_COMPAT == 'G'
+#  include <iostream>
+#endif
 #include <cxxabi.h>
 int main()
 {
-- 
GitLab