summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-21 12:55:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-03-21 12:56:09 (GMT)
commit64bb65777ad011d96c6bedca36b24df7d9a1371d (patch)
treef5c85118257b846a8c985be63f44d988e37888ae
parentdebe4010a82a7cb75b12009893e797c8234eca9c (diff)
parent3b7be02480bbc462f2ebdd0eff156675dd57c50a (diff)
downloadCMake-64bb65777ad011d96c6bedca36b24df7d9a1371d.zip
CMake-64bb65777ad011d96c6bedca36b24df7d9a1371d.tar.gz
CMake-64bb65777ad011d96c6bedca36b24df7d9a1371d.tar.bz2
Merge topic 'ccmake-solaris'
3b7be02480 ccmake: Fix compilation with ncurses on Solaris Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1876
-rw-r--r--Source/CursesDialog/cmCursesStandardIncludes.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h
index 332d2af..60bad94 100644
--- a/Source/CursesDialog/cmCursesStandardIncludes.h
+++ b/Source/CursesDialog/cmCursesStandardIncludes.h
@@ -5,6 +5,11 @@
#include "cmConfigure.h" // IWYU pragma: keep
+// Record whether __attribute__ is currently defined. See purpose below.
+#ifndef __attribute__
+#define cm_no__attribute__
+#endif
+
#if defined(__hpux)
#define _BOOL_DEFINED
#include <sys/time.h>
@@ -29,4 +34,12 @@ inline void curses_clear()
#undef erase
#undef clear
+// The curses headers on some platforms (e.g. Solaris) may
+// define __attribute__ as a macro. This breaks C++ headers
+// in some cases, so undefine it now.
+#if defined(cm_no__attribute__) && defined(__attribute__)
+#undef __attribute__
+#endif
+#undef cm_no__attribute__
+
#endif // cmCursesStandardIncludes_h