From 1c06a170c477c56fbe75d235d37b0f25631b5a48 Mon Sep 17 00:00:00 2001
From: bubnikv <bubnikv@gmail.com>
Date: Tue, 25 Sep 2018 12:48:36 +0200
Subject: [PATCH] Fix compilation on clang

---
 src/libslic3r/Utils.hpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/libslic3r/Utils.hpp b/src/libslic3r/Utils.hpp
index 3e4437fcc..98c15db3c 100644
--- a/src/libslic3r/Utils.hpp
+++ b/src/libslic3r/Utils.hpp
@@ -110,7 +110,10 @@ inline uint64_t next_highest_power_of_2(uint64_t v)
     return ++ v;
 }
 
-#ifdef __GNUC__
+#ifdef __clang__
+// On clang, the size_t is a type of its own, so we need to overload for size_t.
+// On MSC, the size_t type aliases to uint64_t / uint32_t, so the following code
+// gives a duplicate symbol error.
 inline size_t next_highest_power_of_2(size_t v)
 { 
 #if sizeof(size_t) == sizeof(uint32_t)