From 22588fee9d69406a753f70e9b7283cfb5c4bafa3 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Wed, 24 Dec 2025 12:50:13 +0800 Subject: [PATCH] Add CLANG support --- hash_map.h | 7 ++++--- meson.build | 7 ++++++- subprojects/.gitignore | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hash_map.h b/hash_map.h index b8e4f43..279e7f0 100644 --- a/hash_map.h +++ b/hash_map.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "utils_static.h" template @@ -55,9 +56,9 @@ struct hash_map* hash_map_new( uint8_t loadfactor = 60, H hash = H(), std::function probing = std::function(hash_map_quadratic_probing_alter), - std::function malloc = std::function(malloc), - std::function realloc = std::function(realloc), - std::function free = std::function(free), + std::function malloc = std::function(::malloc), + std::function realloc = std::function(::realloc), + std::function free = std::function(::free), std::function free_key = std::function(), std::function free_value = std::function() ) { diff --git a/meson.build b/meson.build index a842318..50ab0c5 100644 --- a/meson.build +++ b/meson.build @@ -38,9 +38,14 @@ endif WIN32 = host_machine.system() in ['windows', 'cygwin'] MSVC = cc.get_id() == 'msvc' +CLANG = cc.get_id() == 'clang' if not MSVC - deps += cc.find_library('m') + if CLANG + deps += cc.find_library('m', required: false) + else + deps += cc.find_library('m') + endif endif if WIN32 diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 355164c..0d8c561 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -1 +1,2 @@ */ +.wraplock