mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
map: Add Map(int, int)
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
#define uint64_t_eq kh_int64_hash_equal
|
#define uint64_t_eq kh_int64_hash_equal
|
||||||
#define uint32_t_hash kh_int_hash_func
|
#define uint32_t_hash kh_int_hash_func
|
||||||
#define uint32_t_eq kh_int_hash_equal
|
#define uint32_t_eq kh_int_hash_equal
|
||||||
|
#define int_hash kh_int_hash_func
|
||||||
|
#define int_eq kh_int_hash_equal
|
||||||
|
|
||||||
#if defined(ARCH_64)
|
#if defined(ARCH_64)
|
||||||
#define ptr_t_hash(key) uint64_t_hash((uint64_t)key)
|
#define ptr_t_hash(key) uint64_t_hash((uint64_t)key)
|
||||||
@@ -109,6 +111,7 @@ static inline bool String_eq(String a, String b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MAP_IMPL(int, int, DEFAULT_INITIALIZER)
|
||||||
MAP_IMPL(cstr_t, uint64_t, DEFAULT_INITIALIZER)
|
MAP_IMPL(cstr_t, uint64_t, DEFAULT_INITIALIZER)
|
||||||
MAP_IMPL(cstr_t, ptr_t, DEFAULT_INITIALIZER)
|
MAP_IMPL(cstr_t, ptr_t, DEFAULT_INITIALIZER)
|
||||||
MAP_IMPL(ptr_t, ptr_t, DEFAULT_INITIALIZER)
|
MAP_IMPL(ptr_t, ptr_t, DEFAULT_INITIALIZER)
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
U map_##T##_##U##_del(Map(T, U) *map, T key); \
|
U map_##T##_##U##_del(Map(T, U) *map, T key); \
|
||||||
void map_##T##_##U##_clear(Map(T, U) *map);
|
void map_##T##_##U##_clear(Map(T, U) *map);
|
||||||
|
|
||||||
|
MAP_DECLS(int, int)
|
||||||
MAP_DECLS(cstr_t, uint64_t)
|
MAP_DECLS(cstr_t, uint64_t)
|
||||||
MAP_DECLS(cstr_t, ptr_t)
|
MAP_DECLS(cstr_t, ptr_t)
|
||||||
MAP_DECLS(ptr_t, ptr_t)
|
MAP_DECLS(ptr_t, ptr_t)
|
||||||
|
Reference in New Issue
Block a user