From 90d270f7c568e6fb0f178119cc4850318ff8a8a9 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 9 May 2014 13:23:15 -0700 Subject: [PATCH] Check for memset_s availability the hard way. --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3f5401b6..d56a3717 100644 --- a/configure.ac +++ b/configure.ac @@ -345,6 +345,17 @@ AS_CASE([$host_cpu], AC_DEFINE([CPU_ALIGNED_ACCESS_REQUIRED], [1], [data alignment is required])] ) +AC_MSG_CHECKING(for memset_s) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +]], [[ +char dummy[42]; +(void) memset_s(dummy, (rsize_t) sizeof dummy, 0, (rsize_t) sizeof dummy); +]])], +[AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_MEMSET_S], [1], [memset_s is available])], +[AC_MSG_RESULT(no)]) + dnl Checks for functions and headers AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)]) @@ -352,7 +363,6 @@ AC_CHECK_FUNC(fegetenv, , [AC_CHECK_LIB(m, fegetenv)]) AS_IF([test "x$EMSCRIPTEN" = "x"],[ AC_CHECK_FUNCS([arc4random arc4random_buf]) - AC_CHECK_FUNCS([memset_s]) ]) AC_CHECK_FUNCS([mlock VirtualLock]) AC_CHECK_FUNCS([SecureZeroMemory explicit_bzero posix_memalign])