summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-14 14:47:47 (GMT)
committerBrad King <brad.king@kitware.com>2024-02-14 14:47:47 (GMT)
commite14300816b9e99ec5c48005217985fd68f317de8 (patch)
treecd69636db98574bbfcd50381ff684ff36a62c08c /Utilities
parent105cb4ee02adcb3754a388b71db54ff8a01b1313 (diff)
downloadCMake-e14300816b9e99ec5c48005217985fd68f317de8.zip
CMake-e14300816b9e99ec5c48005217985fd68f317de8.tar.gz
CMake-e14300816b9e99ec5c48005217985fd68f317de8.tar.bz2
librhash: aligned_alloc is not available with glibc < 2.15
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibrhash/librhash/util.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Utilities/cmlibrhash/librhash/util.h b/Utilities/cmlibrhash/librhash/util.h
index 51d5472..a0a0674 100644
--- a/Utilities/cmlibrhash/librhash/util.h
+++ b/Utilities/cmlibrhash/librhash/util.h
@@ -2,6 +2,8 @@
#ifndef UTIL_H
#define UTIL_H
+#include <stdlib.h> /* for aligned_alloc and __GLIBC__ version macros */
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -42,12 +44,12 @@ extern "C" {
# define rhash_aligned_free(ptr) _aligned_free(ptr)
#elif !defined(NO_STDC_ALIGNED_ALLOC) && (__STDC_VERSION__ >= 201112L || defined(_ISOC11_SOURCE)) \
+ && !(defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 15))) \
&& !(defined(__ibmxl__) && defined(__clang__) && defined(__linux__)) \
&& !defined(__APPLE__) && !defined(__HAIKU__) && !defined(__sun) \
&& (!defined(__ANDROID_API__) || __ANDROID_API__ >= 28)
# define HAS_STDC_ALIGNED_ALLOC
-# include <stdlib.h>
# define rhash_aligned_alloc(alignment, size) aligned_alloc((alignment), ALIGN_SIZE_BY(size, alignment))
# define rhash_aligned_free(ptr) free(ptr)
@@ -58,7 +60,6 @@ extern "C" {
# if !defined(NO_POSIX_ALIGNED_ALLOC) && (_POSIX_VERSION >= 200112L || _XOPEN_SOURCE >= 600)
# define HAS_POSIX_ALIGNED_ALLOC
-# include <stdlib.h>
# define rhash_aligned_alloc(alignment, size) rhash_px_aalloc((alignment), ALIGN_SIZE_BY(size, sizeof(void*)))
# define rhash_aligned_free(ptr) free(ptr)
void* rhash_px_aalloc(size_t size, size_t alignment);