aboutsummaryrefslogtreecommitdiffstats
path: root/safercpp/safercpp-arr.cpp
diff options
context:
space:
mode:
authorduneroadrunner <duneroadrunner@gmail.com>2017-07-18 18:15:55 +0000
committerduneroadrunner <duneroadrunner@gmail.com>2017-07-18 18:15:55 +0000
commitfd7791137a430719a10fde02981160e87bbae558 (patch)
tree316e5d974ea2bea0a61255dbd3de7bd2d6c473fd /safercpp/safercpp-arr.cpp
parentinvestigating the importation of translation units into the current ast (diff)
downloadmutator-fd7791137a430719a10fde02981160e87bbae558.tar.gz
mutator-fd7791137a430719a10fde02981160e87bbae558.zip
oops, fixed broken preprocessor condition for
switching BeginSourceFileAction() interfaces
Diffstat (limited to '')
-rw-r--r--safercpp/safercpp-arr.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/safercpp/safercpp-arr.cpp b/safercpp/safercpp-arr.cpp
index 6989d8b..1e249f9 100644
--- a/safercpp/safercpp-arr.cpp
+++ b/safercpp/safercpp-arr.cpp
@@ -6680,20 +6680,6 @@ public:
CompilerInstance &CI;
};
-//from this post: https://stackoverflow.com/questions/2335888/how-to-compare-string-in-c-conditional-preprocessor-directives
-// compares two strings in compile time constant fashion
-constexpr int c_strcmp( char const* lhs, char const* rhs )
-{
- return (('\0' == lhs[0]) && ('\0' == rhs[0])) ? 0
- : (lhs[0] != rhs[0]) ? (lhs[0] - rhs[0])
- : c_strcmp( lhs+1, rhs+1 );
-}
-// some compilers may require ((int)lhs[0] - (int)rhs[0])
-
-// The API seems to have been (breaking) changed in commit r305045.
-// See: https://github.com/llvm-mirror/clang/commit/772553c418344b6943a468b79e043180840eb255
-constexpr int DIFF_FROM_r305045 = c_strcmp(LLVM_VERSION_STRING, "5.0.0svn-r305045");
-constexpr int DIFF_FROM_VERSION_ZERO = c_strcmp(LLVM_VERSION_STRING, "0");
class MyFrontendAction : public ASTFrontendAction
{
@@ -6708,7 +6694,11 @@ public:
}
}
-#if (0 > DIFF_FROM_r305045) && (0 < DIFF_FROM_ZERO)
+#if 5 > LLVM_VERSION_MAJOR
+#define LLVM_OLDER_THAN_r305045
+#endif
+
+#ifdef LLVM_OLDER_THAN_r305045
bool BeginSourceFileAction(CompilerInstance &ci, StringRef) override {
#else
bool BeginSourceFileAction(CompilerInstance &ci) override {