])
CFLAGS="$oldCFLAGS"
+AC_MSG_CHECKING([For localtime_s])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>],[[
+ struct tm tm;
+ time_t t = 0;
+ localtime_s(&tm, (time_t)0);]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_LOCALTIME_S, 1, [Have localtime_s() function])],
+ [AC_MSG_RESULT([no])])
+
+AC_MSG_CHECKING([For localtime_r])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>],[[
+ struct tm tm;
+ time_t t = 0;
+ localtime_r(&t, &tm);]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_LOCALTIME_R, 1, [Have localtime_r() function])],
+ [AC_MSG_RESULT([no])])
+
if test "$have_win" = yes; then
# Checking "properly" for __attribute__((dllimport,stdcall)) functions is non-trivial
LIBS="$LIBS -lws2_32 -lshlwapi -lsecur32 -liphlpapi"
goto badlist;
}
- localtime_r(&when, &tm);
- strftime(tmbuf, 80, "%a, %d %b %Y %H:%M:%S %Z", &tm);
+ if (0
+#ifdef HAVE_LOCALTIME_S
+ || !localtime_s(&tm, &when)
+#endif
+#ifdef HAVE_LOCALTIME_R
+ || localtime_r(&when, &tm)
+#endif
+ ) {
+ strftime(tmbuf, sizeof(tmbuf), "%a, %d %b %Y %H:%M:%S %Z", &tm);
+ } else
+ snprintf(tmbuf, sizeof(tmbuf), "@%lu", (unsigned long)when);
+
buf_append(form_msg, " - %s from %s at %s\n", sessid, from, tmbuf);
free(from);
o.choices[i] = malloc(sizeof(struct oc_choice));
<ul>
<li><b>OpenConnect HEAD</b>
<ul>
- <li><i>No changelog entries yet</i></li>
+ <li>Fix Windows build with MSYS2 (<a href="https://gitlab.com/openconnect/openconnect/issues/74">#74</a>).</li>
</ul><br/>
</li>
<li><b><a href="ftp://ftp.infradead.org/pub/openconnect/openconnect-8.05.tar.gz">OpenConnect v8.05</a></b>