diff --git a/src/main.cpp2 b/src/main.cpp2 index 73de00a..5f75cb4 100644 --- a/src/main.cpp2 +++ b/src/main.cpp2 @@ -767,10 +767,7 @@ hash_file: (p: fs::path) -> u64 = { buffer.resize(size); f.read(buffer.data(), size); if f.fail() { return 0; } - return constexpr_xxh3::XXH3_64bits(buffer.data(), buffer.size()); -} - -cpp2b_data_file: type = { + return XXH3_64bits(buffer.data(), buffer.size()); } do_build: (targets: std::vector) -> (stuff: full_build_info, exit_code: int) = { @@ -833,7 +830,6 @@ do_build: (targets: std::vector) -> (stuff: full_build_info, exit_c transpile_futures: std::vector> = (); cpp2b_parse_futures: std::vector> = (); file_hash_futures: std::unordered_map> = (); - file_hash_futures: std::unordered_map> = (); transpile_futures.reserve(cpp2_source_files.size()); cpp2b_parse_futures.reserve(cpp2_source_files.size()); diff --git a/src/xxh3.cppm b/src/xxh3.cppm index 7e4a927..ae82e94 100644 --- a/src/xxh3.cppm +++ b/src/xxh3.cppm @@ -51,8 +51,6 @@ module; export module xxh3; -export namespace constexpr_xxh3 { - template concept ByteType = (std::is_integral_v && sizeof(T) == 1) #if defined __cpp_lib_byte && __cpp_lib_byte >= 201603 @@ -300,7 +298,7 @@ constexpr size_t bytes_size(T (&)[N]) noexcept { /// Basic interfaces -template +export template constexpr uint64_t XXH3_64bits(const T* input, size_t len) noexcept { return XXH3_64bits_internal( input, len, 0, kSecret, sizeof(kSecret), @@ -310,7 +308,7 @@ constexpr uint64_t XXH3_64bits(const T* input, size_t len) noexcept { }); } -template +export template constexpr uint64_t XXH3_64bits_withSecret(const T* input, size_t len, const S* secret, size_t secretSize) noexcept { @@ -322,7 +320,7 @@ constexpr uint64_t XXH3_64bits_withSecret(const T* input, size_t len, }); } -template +export template constexpr uint64_t XXH3_64bits_withSeed(const T* input, size_t len, uint64_t seed) noexcept { if (seed == 0) return XXH3_64bits(input, len); @@ -341,24 +339,21 @@ constexpr uint64_t XXH3_64bits_withSeed(const T* input, size_t len, /// Convenient interfaces -template +export template constexpr uint64_t XXH3_64bits(const Bytes& input) noexcept { return XXH3_64bits(std::data(input), bytes_size(input)); } -template +export template constexpr uint64_t XXH3_64bits_withSecret(const Bytes& input, const Secret& secret) noexcept { return XXH3_64bits_withSecret(std::data(input), bytes_size(input), std::data(secret), bytes_size(secret)); } -template +export template constexpr uint64_t XXH3_64bits_withSeed(const Bytes& input, uint64_t seed) noexcept { return XXH3_64bits_withSeed(std::data(input), bytes_size(input), seed); } -} // namespace constexpr_xxh3 - -