diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-03-05 19:54:31 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-03-05 19:54:45 +0000 |
commit | 65ba2f310d6475d0a829e6c036acba6f68496b3b (patch) | |
tree | 03a8283f1648fee5da732479a8273e6eddba9ebc | |
parent | afdf53b2e4d73dd4615587da4a61f41cf5a77cd9 (diff) | |
download | rspamd-65ba2f310d6475d0a829e6c036acba6f68496b3b.tar.gz rspamd-65ba2f310d6475d0a829e6c036acba6f68496b3b.zip |
[Minor] Fix build with old hyperscan...
-rw-r--r-- | src/libserver/hyperscan_tools.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libserver/hyperscan_tools.cxx b/src/libserver/hyperscan_tools.cxx index 574813841..05da04c40 100644 --- a/src/libserver/hyperscan_tools.cxx +++ b/src/libserver/hyperscan_tools.cxx @@ -41,10 +41,13 @@ // failing at `hs_alloc_scratch` phase or even `hs_scan` which is **way too late** // Hence, we have to check hyperscan internal guts to prevent that situation... +#ifdef HS_MAJOR #ifndef HS_VERSION_32BIT #define HS_VERSION_32BIT ((HS_MAJOR << 24) | (HS_MINOR << 16) | (HS_PATCH << 8) | 0) #endif -#ifndef HS_DB_VERSION +#endif // defined(HS_MAJOR) + +#if !defined(HS_DB_VERSION) && defined(HS_VERSION_32BIT) #define HS_DB_VERSION HS_VERSION_32BIT #endif @@ -353,10 +356,12 @@ hs_is_valid_database(void *raw, std::size_t len, std::string_view fname) -> tl:: fname, test.magic, HS_DB_MAGIC)); } +#ifdef HS_DB_VERSION if (test.version != HS_DB_VERSION) { return tl::make_unexpected(fmt::format("cannot load hyperscan database from {}: invalid version: {} ({} expected)", fname, test.version, HS_DB_VERSION)); } +#endif return true; } |