chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:47:42 +08:00
commit be3ef883e1
1214 changed files with 431743 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
set(SPARSE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/sparseconfig.h")
set(SPARSE_DST "${CMAKE_CURRENT_SOURCE_DIR}/sparsehash-2.0.4/src/sparsehash/internal/sparseconfig.h")
get_filename_component(DESTINATION_DIR "${SPARSE_DST}" DIRECTORY)
if(NOT EXISTS "${SPARSE_DST}")
file(COPY "${SPARSE_SRC}" DESTINATION "${DESTINATION_DIR}")
endif()
if(MSVC)
set(SPARSEHASH_WINDOWS_PATCH ${CMAKE_CURRENT_SOURCE_DIR}/sparsehash.windows.patch)
apply_patch_once("sparsehash.windows.patch" "${DESTINATION_DIR}" "${SPARSEHASH_WINDOWS_PATCH}")
endif()
add_library(sparsehash INTERFACE)
target_include_directories(
sparsehash SYSTEM INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/sparsehash-2.0.4/src/"
)
+46
View File
@@ -0,0 +1,46 @@
/*
* NOTE: This file is for internal use only.
* Do not use these #defines in your own program!
*/
/* Namespace for Google classes */
#define GOOGLE_NAMESPACE ::google
/* the location of the header defining hash functions */
#define HASH_FUN_H <functional>
/* the namespace of the hash<> function */
#define HASH_NAMESPACE std
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if the system has the type `uint16_t'. */
#define HAVE_UINT16_T 1
/* Define to 1 if the system has the type `u_int16_t'. */
#define HAVE_U_INT16_T 1
/* Define to 1 if the system has the type `__uint16'. */
/* #undef HAVE___UINT16 */
/* The system-provided hash function including the namespace. */
#define SPARSEHASH_HASH HASH_NAMESPACE::hash
/* Stops putting the code inside the Google namespace */
#define _END_GOOGLE_NAMESPACE_ }
/* Puts following code inside the Google namespace */
#define _START_GOOGLE_NAMESPACE_ namespace google {
+13
View File
@@ -0,0 +1,13 @@
diff --git a/src/sparsehash/internal/hashtable-common.h b/src/sparsehash/internal/hashtable-common.h
index bac2b88..59c752c 100644
--- a/src/sparsehash/internal/hashtable-common.h
+++ b/src/sparsehash/internal/hashtable-common.h
@@ -51,7 +51,7 @@ _START_GOOGLE_NAMESPACE_
template <bool> struct SparsehashCompileAssert { };
#define SPARSEHASH_COMPILE_ASSERT(expr, msg) \
- __attribute__((unused)) typedef SparsehashCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
+ static_assert(bool(expr), #msg)
namespace sparsehash_internal {