Merge pull request #67 from chaorunrun/compile-for-c++17
Fix errors on compilation with c++17
This commit is contained in:
commit
3afe7193fa
@ -45,11 +45,9 @@ endif()
|
|||||||
# Using span from std
|
# Using span from std
|
||||||
if (NOT UUID_USING_CXX20_SPAN)
|
if (NOT UUID_USING_CXX20_SPAN)
|
||||||
target_include_directories(${PROJECT_NAME} INTERFACE
|
target_include_directories(${PROJECT_NAME} INTERFACE
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gsl>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
$<INSTALL_INTERFACE:include/gsl>)
|
$<INSTALL_INTERFACE:include>)
|
||||||
if(UUID_ENABLE_INSTALL)
|
install(DIRECTORY gsl DESTINATION include)
|
||||||
install(DIRECTORY gsl DESTINATION include)
|
|
||||||
endif()
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if(UUID_ENABLE_INSTALL)
|
if(UUID_ENABLE_INSTALL)
|
||||||
|
|||||||
@ -16,7 +16,21 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
# if (__cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
|
||||||
|
# define LIBUUID_CPP20_OR_GREATER
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef LIBUUID_CPP20_OR_GREATER
|
||||||
#include <span>
|
#include <span>
|
||||||
|
#else
|
||||||
|
#include <gsl/span>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user