fix alloca usage
authorMichael Wallner <mike@php.net>
Fri, 27 Nov 2020 16:24:39 +0000 (17:24 +0100)
committerMichael Wallner <mike@php.net>
Fri, 27 Nov 2020 16:24:39 +0000 (17:24 +0100)
CMake/_Include.cmake
src/libmemcached/assert.hpp
src/libmemcachedutil/pool.cc

index 6a5598d9235edae1ef476d3aa609fdd797ce15d8..7c1b546d24040f331d3d3714b1b143c630b350c9 100644 (file)
@@ -115,7 +115,7 @@ configure_set(HAVE_FNV64_HASH ${ENABLE_HASH_FNV64})
 configure_set(HAVE_MURMUR_HASH ${ENABLE_HASH_MURMUR})
 configure_set(HAVE_HSIEH_HASH ${ENABLE_HASH_HSIEH})
 
-# most of the following checks are due to mingw or msvc; see gnulib
+check_include(alloca.h)
 check_include(arpa/inet.h)
 check_include(dlfcn.h)
 check_include(netdb.h)
index 4088c0f10e813b9cf4beb8c88d2fa209f202c7f1..abad23d16d49e32f80b13de4fa3ce3b78ce8f740 100644 (file)
 
 #  ifdef __cplusplus
 #    include <cstdarg>
+#    include <cstdlib>
 #    include <cstdio>
 #  else
 #    include <stdarg.h>
+#    include <stdlib.h>
 #    include <stdio.h>
 #  endif
 
+#  ifdef HAVE_ALLOCA_H
+#    include <alloca.h>
+#  endif
+
 #  include "libmemcached/backtrace.hpp"
 
 #  define assert_msg(__expr, __mesg) \
index c2185141b6c3e6cec7d788c8c2cf4c6816299f87..7a601d13aa2689585d4dcc6d912813940c811bd5 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "libmemcachedutil/common.h"
 
-#include <alloca.h>
 #include <cassert>
 #include <cerrno>
 #include <cstring>