summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-15 17:53:07 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-02-15 17:53:14 (GMT)
commit2f89f1f5e27a2e85f09de8ea19dfe8b76af64d7b (patch)
treecd69636db98574bbfcd50381ff684ff36a62c08c
parent105cb4ee02adcb3754a388b71db54ff8a01b1313 (diff)
parente14300816b9e99ec5c48005217985fd68f317de8 (diff)
downloadCMake-2f89f1f5e27a2e85f09de8ea19dfe8b76af64d7b.zip
CMake-2f89f1f5e27a2e85f09de8ea19dfe8b76af64d7b.tar.gz
CMake-2f89f1f5e27a2e85f09de8ea19dfe8b76af64d7b.tar.bz2
Merge topic 'librhash-glibc-version' into release-3.29
e14300816b librhash: aligned_alloc is not available with glibc < 2.15 Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9255
-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);