mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-02 15:05:16 +00:00
[#1174] Fixed the same duration type bug
This commit is contained in:
15
configure.ac
15
configure.ac
@@ -172,6 +172,21 @@ AC_COMPILE_IFELSE(
|
|||||||
[Define to 1 if std::is_base_of is available])],
|
[Define to 1 if std::is_base_of is available])],
|
||||||
[AC_MSG_RESULT(no)])
|
[AC_MSG_RESULT(no)])
|
||||||
|
|
||||||
|
# Check if system and steady clocks use the same duration type.
|
||||||
|
AC_MSG_CHECKING([for different std::chrono::duration types])
|
||||||
|
AC_COMPILE_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM(
|
||||||
|
[#include <chrono>
|
||||||
|
#include <type_traits>]
|
||||||
|
[static_assert(!std::is_same<
|
||||||
|
std::chrono::system_clock::duration,
|
||||||
|
std::chrono::steady_clock::duration
|
||||||
|
>::value, "");])],
|
||||||
|
[AC_MSG_RESULT(yes)],
|
||||||
|
[AC_MSG_RESULT(no)
|
||||||
|
AC_DEFINE([CHRONO_SAME_DURATION], [1],
|
||||||
|
[Define to 1 if system and steady clocks use the same duration type])])
|
||||||
|
|
||||||
dnl Determine if we are using GNU sed
|
dnl Determine if we are using GNU sed
|
||||||
GNU_SED=no
|
GNU_SED=no
|
||||||
$SED --version 2> /dev/null | grep GNU > /dev/null 2>&1
|
$SED --version 2> /dev/null | grep GNU > /dev/null 2>&1
|
||||||
|
@@ -92,9 +92,11 @@ template std::string
|
|||||||
durationToText<system_clock::duration>(system_clock::duration dur,
|
durationToText<system_clock::duration>(system_clock::duration dur,
|
||||||
size_t fsecs_precision);
|
size_t fsecs_precision);
|
||||||
|
|
||||||
|
#if !CHRONO_SAME_DURATION
|
||||||
template std::string
|
template std::string
|
||||||
durationToText<steady_clock::duration>(steady_clock::duration dur,
|
durationToText<steady_clock::duration>(steady_clock::duration dur,
|
||||||
size_t fsecs_precision);
|
size_t fsecs_precision);
|
||||||
|
#endif
|
||||||
|
|
||||||
} // end of isc::util namespace
|
} // end of isc::util namespace
|
||||||
} // end of isc namespace
|
} // end of isc namespace
|
||||||
|
Reference in New Issue
Block a user