summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-30 22:09:28 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-30 22:09:28 +0300
commitd3d6c6fc60a878b2742bb614e87fee0a04c69759 (patch)
treea7d81843fcda860a03c6e58dbb07308f069785b7
parentb8fefae63e5ddd8a3463988fbfeaea25d389e225 (diff)
downloadmv-d3d6c6fc60a878b2742bb614e87fee0a04c69759.tar.gz
mv-d3d6c6fc60a878b2742bb614e87fee0a04c69759.tar.bz2
mv-d3d6c6fc60a878b2742bb614e87fee0a04c69759.tar.xz
mv-d3d6c6fc60a878b2742bb614e87fee0a04c69759.zip
Fix some macro definition for some compiler versions.
Add clang version macro.
-rw-r--r--src/localconsts.h9
-rw-r--r--src/utils/base64.cpp3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/localconsts.h b/src/localconsts.h
index df49f8098..4b1616db1 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -33,6 +33,12 @@
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
+#ifdef __clang__
+#define CLANG_VERSION (__clang_major__ * 10000 \
+ + __clang_minor__ * 100 \
+ + __clang_patchlevel__)
+#endif // __clang__
+
#if !defined(__GXX_EXPERIMENTAL_CXX0X__)
#undef nullptr
#define nullptr 0
@@ -55,6 +61,7 @@
#define noexcept
#endif // __clang__
#define noexcept2
+#define constexpr2
// #define A_DELETE
// #define A_DELETE_COPY
@@ -174,7 +181,7 @@
#ifdef __clang__
#define PRAGMACLANG(str) _Pragma(#str)
-#if __clang_major__ >= 6
+#if CLANG_VERSION >= 30800
#define PRAGMACLANG6(str) _Pragma(#str)
#else // __clang_major__ >= 6
#define PRAGMACLANG6(str)
diff --git a/src/utils/base64.cpp b/src/utils/base64.cpp
index ddf117ec4..b0828e99f 100644
--- a/src/utils/base64.cpp
+++ b/src/utils/base64.cpp
@@ -162,6 +162,9 @@ unsigned char *php3_base64_decode(const unsigned char *restrict const string,
return nullptr;
case 2:
k++;
+ // copy from 3. is it should be here?
+ result[k++] = 0;
+ break;
case 3:
result[k++] = 0;
break;