diff options
| author | dhust <rafaelmoura.dev@gmail.com> | 2016-06-16 17:31:51 -0300 |
|---|---|---|
| committer | dhust <rafaelmoura.dev@gmail.com> | 2016-06-19 18:32:19 -0300 |
| commit | 19fed720ff4a0acf7effc5e1b11b2cedbde009dc (patch) | |
| tree | 5d22eb091f1f8850d96ff59a74555ad819d6a0aa | |
| parent | c8d0eb103af305715d180e218878ba2e32208051 (diff) | |
_DEFAULT_SOURCE flag added, and clang check for IsTriviallyCopyable macro
fix clang ver check for 4.0 +
using clang macro __has_feature
__GLIBCXX__ check added
fix __has_feature
| -rw-r--r-- | CMakeLists.txt | 2 | ||||
| -rw-r--r-- | Source/Core/Common/ChunkFile.h | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bf7f55f81..d9bbff0d45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,7 +209,7 @@ endmacro() # Enabling all warnings in MSVC spams too much if(NOT MSVC) add_definitions(-Wall) - + add_definitions(-D_DEFAULT_SOURCE) # TODO: would like these but they produce overwhelming amounts of warnings #check_and_add_flag(EXTRA -Wextra) #check_and_add_flag(MISSING_FIELD_INITIALIZERS -Wmissing-field-initializers) diff --git a/Source/Core/Common/ChunkFile.h b/Source/Core/Common/ChunkFile.h index 0f177e6761..67066dd206 100644 --- a/Source/Core/Common/ChunkFile.h +++ b/Source/Core/Common/ChunkFile.h @@ -32,7 +32,12 @@ #include "Common/Logging/Log.h" // ewww -#if _LIBCPP_VERSION || __GNUC__ >= 5 + +#ifndef __has_feature + #define __has_feature(x) (0) +#endif + +#if (__has_feature(is_trivially_copyable) && (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__))) || (defined(__GNUC__) && __GNUC__ >= 5) #define IsTriviallyCopyable(T) std::is_trivially_copyable<typename std::remove_volatile<T>::type>::value #elif __GNUC__ #define IsTriviallyCopyable(T) std::has_trivial_copy_constructor<T>::value |
