From df8908b9dc0a4583c4b426cbbe47249cd895e16a Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Sat, 30 Dec 2017 09:25:26 +0100 Subject: nxcomp/configure.ac: add check for ::ctime_s. --- nxcomp/configure.ac | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'nxcomp') diff --git a/nxcomp/configure.ac b/nxcomp/configure.ac index 12c3b5004..b7350a45e 100644 --- a/nxcomp/configure.ac +++ b/nxcomp/configure.ac @@ -94,6 +94,23 @@ std::tm tm = *std::localtime(&t); [Use std::put_time to format times, must be made available by the compiler if turned on.])], [AC_MSG_RESULT([no])]) +# Check if ::ctime_s is available. +AC_MSG_CHECKING([if ::ctime_s is available]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[ +#define __STDC_WANT_LIB_EXT1__ 1 +#include +]], +[[ +time_t res = time(NULL); +char str[26] = { }; +::ctime_s(str, sizeof(str), &res); +]])], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_CTIME_S, [1], + [Use ::ctime_s to format times, must be made available by the compiler if turned on.])], + [AC_MSG_RESULT([no])]) + AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [enable to get info session log output (disabled by default)])], -- cgit v1.2.3