diff options
author | Mihai Moldovan <ionic@ionic.de> | 2017-12-30 09:25:26 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2018-01-08 23:56:28 +0100 |
commit | df8908b9dc0a4583c4b426cbbe47249cd895e16a (patch) | |
tree | b3075d8ebd134b8581667dd47d1a5cd986adb4a1 /nxcomp/configure.ac | |
parent | 70e1e6a011126aa027456ad4b3163f67d72c034f (diff) | |
download | nx-libs-df8908b9dc0a4583c4b426cbbe47249cd895e16a.tar.gz nx-libs-df8908b9dc0a4583c4b426cbbe47249cd895e16a.tar.bz2 nx-libs-df8908b9dc0a4583c4b426cbbe47249cd895e16a.zip |
nxcomp/configure.ac: add check for ::ctime_s.
Diffstat (limited to 'nxcomp/configure.ac')
-rw-r--r-- | nxcomp/configure.ac | 17 |
1 files changed, 17 insertions, 0 deletions
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 <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], [AS_HELP_STRING([--enable-debug], [enable to get info session log output (disabled by default)])], |