summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-30 17:49:50 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-30 17:49:50 +0300
commita344b0036c91ae0b9591803a0e18356bf8f37697 (patch)
tree504b8d013230bd285cc2c8ce96194a82b268a072
parent9e9a269cc0548f017b756f4158c957fb1edb894f (diff)
downloadmanaverse-a344b0036c91ae0b9591803a0e18356bf8f37697.tar.gz
manaverse-a344b0036c91ae0b9591803a0e18356bf8f37697.tar.bz2
manaverse-a344b0036c91ae0b9591803a0e18356bf8f37697.tar.xz
manaverse-a344b0036c91ae0b9591803a0e18356bf8f37697.zip
Add macro with pragma for clang with some versions.
-rw-r--r--src/localconsts.h6
-rw-r--r--src/utils/process.cpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/localconsts.h b/src/localconsts.h
index 881680c93..dc63ad87b 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -157,8 +157,14 @@
#ifdef __clang__
#define PRAGMACLANG(str) _Pragma(#str)
+#if __clang_major__ >= 6
+#define PRAGMACLANG6(str) _Pragma(#str)
+#else // __clang_major__ >= 6
+#define PRAGMACLANG6(str)
+#endif // __clang_major__ >= 6
#else // __clang__
#define PRAGMACLANG(str)
+#define PRAGMACLANG6(str)
#endif // __clang__
#ifdef __GNUC__
diff --git a/src/utils/process.cpp b/src/utils/process.cpp
index a1c9d8a72..72deaad5b 100644
--- a/src/utils/process.cpp
+++ b/src/utils/process.cpp
@@ -212,10 +212,10 @@ bool execFile(const std::string &pathName, const std::string &name,
arg2.c_str(), static_cast<char *>(nullptr));
}
_exit(-1);
- PRAGMA45(GCC diagnostic push)
- PRAGMA45(GCC diagnostic ignored "-Wunreachable-code-return")
+ PRAGMACLANG6(GCC diagnostic push)
+ PRAGMACLANG6(GCC diagnostic ignored "-Wunreachable-code-return")
return false;
- PRAGMA45(GCC diagnostic pop)
+ PRAGMACLANG6(GCC diagnostic pop)
}
return true;
}