Commit df8908b9 authored by Mihai Moldovan's avatar Mihai Moldovan

nxcomp/configure.ac: add check for ::ctime_s.

parent 70e1e6a0
...@@ -94,6 +94,23 @@ std::tm tm = *std::localtime(&t); ...@@ -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.])], [Use std::put_time to format times, must be made available by the compiler if turned on.])],
[AC_MSG_RESULT([no])]) [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 <ctime>
]],
[[
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], AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [AS_HELP_STRING([--enable-debug],
[enable to get info session log output (disabled by default)])], [enable to get info session log output (disabled by default)])],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment