From 27ecec11cf1c76fdb2e84a3cd6392749142a6506 Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Fri, 8 Feb 2019 15:41:01 +0100
Subject: [PATCH] MSVC minimum version and clang identification

- fail to build when MSVC version too low
- properly identify clang as compiler
---
 source/Lib/CommonLib/CommonDef.h | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/source/Lib/CommonLib/CommonDef.h b/source/Lib/CommonLib/CommonDef.h
index de3f6bef..6d09dc35 100644
--- a/source/Lib/CommonLib/CommonDef.h
+++ b/source/Lib/CommonLib/CommonDef.h
@@ -53,9 +53,10 @@
 #include "TypeDef.h"
 #include "version.h"
 
+// MS Visual Studio before 2014 does not support required C++11 features
 #ifdef _MSC_VER
-#if _MSC_VER <= 1500
-inline int64_t abs (int64_t x) { return _abs64(x); };
+#if _MSC_VER < 1900
+#error "MS Visual Studio version not supported. Please upgrade to Visual Studio 2015 or higher (or use other compilers)"
 #endif
 #endif
 
@@ -66,7 +67,14 @@ inline int64_t abs (int64_t x) { return _abs64(x); };
 // Platform information
 // ====================================================================================================================
 
-#ifdef __GNUC__
+#ifdef __clang__
+#define NVM_COMPILEDBY  "[clang %d.%d.%d]", __clang_major__, __clang_minor__, __clang_patchlevel__
+#ifdef __IA64__
+#define NVM_ONARCH    "[on 64-bit] "
+#else
+#define NVM_ONARCH    "[on 32-bit] "
+#endif
+#elif __GNUC__
 #define NVM_COMPILEDBY  "[GCC %d.%d.%d]", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__
 #ifdef __IA64__
 #define NVM_ONARCH    "[on 64-bit] "
-- 
GitLab