mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32:46 +01:00
merge #18358: fix compilation with mingw-w64 7.0.0
This commit is contained in:
parent
199a0f8d26
commit
1d5c176943
17
configure.ac
17
configure.ac
@ -913,6 +913,22 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
|
||||
)
|
||||
LDFLAGS="$TEMP_LDFLAGS"
|
||||
|
||||
dnl check for gmtime_r(), fallback to gmtime_s() if that is unavailable
|
||||
dnl fail if neither are available.
|
||||
AC_MSG_CHECKING(for gmtime_r)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
|
||||
[[ gmtime_r((const time_t *) nullptr, (struct tm *) nullptr); ]])],
|
||||
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GMTIME_R, 1, [Define this symbol if gmtime_r is available]) ],
|
||||
[ AC_MSG_RESULT(no);
|
||||
AC_MSG_CHECKING(for gmtime_s);
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
|
||||
[[ gmtime_s((struct tm *) nullptr, (const time_t *) nullptr); ]])],
|
||||
[ AC_MSG_RESULT(yes)],
|
||||
[ AC_MSG_RESULT(no); AC_MSG_ERROR(Both gmtime_r and gmtime_s are unavailable) ]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
# Check for different ways of gathering OS randomness
|
||||
AC_MSG_CHECKING(for Linux getrandom syscall)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
|
||||
@ -1574,6 +1590,7 @@ AC_SUBST(HAVE_BUILTIN_PREFETCH)
|
||||
AC_SUBST(HAVE_MM_PREFETCH)
|
||||
AC_SUBST(HAVE_STRONG_GETAUXVAL)
|
||||
AC_SUBST(HAVE_WEAK_GETAUXVAL)
|
||||
AC_SUBST(HAVE_GMTIME_R)
|
||||
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
|
||||
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
|
||||
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
|
||||
|
@ -76,10 +76,10 @@ int64_t GetSystemTimeInSeconds()
|
||||
std::string FormatISO8601DateTime(int64_t nTime) {
|
||||
struct tm ts;
|
||||
time_t time_val = nTime;
|
||||
#ifdef _MSC_VER
|
||||
gmtime_s(&ts, &time_val);
|
||||
#else
|
||||
#ifdef HAVE_GMTIME_R
|
||||
gmtime_r(&time_val, &ts);
|
||||
#else
|
||||
gmtime_s(&ts, &time_val);
|
||||
#endif
|
||||
return strprintf("%04i-%02i-%02iT%02i:%02i:%02iZ", ts.tm_year + 1900, ts.tm_mon + 1, ts.tm_mday, ts.tm_hour, ts.tm_min, ts.tm_sec);
|
||||
}
|
||||
@ -87,10 +87,10 @@ std::string FormatISO8601DateTime(int64_t nTime) {
|
||||
std::string FormatISO8601Date(int64_t nTime) {
|
||||
struct tm ts;
|
||||
time_t time_val = nTime;
|
||||
#ifdef _MSC_VER
|
||||
gmtime_s(&ts, &time_val);
|
||||
#else
|
||||
#ifdef HAVE_GMTIME_R
|
||||
gmtime_r(&time_val, &ts);
|
||||
#else
|
||||
gmtime_s(&ts, &time_val);
|
||||
#endif
|
||||
return strprintf("%04i-%02i-%02i", ts.tm_year + 1900, ts.tm_mon + 1, ts.tm_mday);
|
||||
}
|
||||
@ -98,10 +98,10 @@ std::string FormatISO8601Date(int64_t nTime) {
|
||||
std::string FormatISO8601Time(int64_t nTime) {
|
||||
struct tm ts;
|
||||
time_t time_val = nTime;
|
||||
#ifdef _MSC_VER
|
||||
gmtime_s(&ts, &time_val);
|
||||
#else
|
||||
#ifdef HAVE_GMTIME_R
|
||||
gmtime_r(&time_val, &ts);
|
||||
#else
|
||||
gmtime_s(&ts, &time_val);
|
||||
#endif
|
||||
return strprintf("%02i:%02i:%02iZ", ts.tm_hour, ts.tm_min, ts.tm_sec);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user