Просмотр исходного кода

Merge pull request #1705 from LittleWhite-tb/compat_gcc49

Protect use of std::is_trivially_copyable to compile with GCC 4.9
bunnei 10 лет назад
Родитель
Сommit
4c9ed98084
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      src/common/file_util.h

+ 4 - 0
src/common/file_util.h

@@ -192,7 +192,9 @@ public:
     size_t ReadArray(T* data, size_t length)
     {
         static_assert(std::is_standard_layout<T>(), "Given array does not consist of standard layout objects");
+#if (__GNUC__ >= 5) || defined(__clang__) || defined(_MSC_VER)
         static_assert(std::is_trivially_copyable<T>(), "Given array does not consist of trivially copyable objects");
+#endif
 
         if (!IsOpen()) {
             m_good = false;
@@ -210,7 +212,9 @@ public:
     size_t WriteArray(const T* data, size_t length)
     {
         static_assert(std::is_standard_layout<T>(), "Given array does not consist of standard layout objects");
+#if (__GNUC__ >= 5) || defined(__clang__) || defined(_MSC_VER)
         static_assert(std::is_trivially_copyable<T>(), "Given array does not consist of trivially copyable objects");
+#endif
 
         if (!IsOpen()) {
             m_good = false;