diff --git a/src/spicy/manager.cc b/src/spicy/manager.cc index 6d6cd3f059..4ae035cf90 100644 --- a/src/spicy/manager.cc +++ b/src/spicy/manager.cc @@ -101,13 +101,7 @@ void Manager::registerProtocolAnalyzer(const std::string& name, hilti::rt::Proto analyzer::Component::factory_callback factory = nullptr; -#if SPICY_VERSION_NUMBER >= 10700 - auto proto_ = proto.value(); -#else - auto proto_ = proto; -#endif - - switch ( proto_ ) { + switch ( proto.value() ) { case hilti::rt::Protocol::TCP: factory = spicy::rt::TCP_Analyzer::InstantiateAnalyzer; break; case hilti::rt::Protocol::UDP: factory = spicy::rt::UDP_Analyzer::InstantiateAnalyzer; break; default: reporter->Error("unsupported protocol in analyzer"); return; @@ -564,9 +558,7 @@ plugin::Configuration Manager::Configure() { void Manager::InitPreScript() { SPICY_DEBUG("Beginning pre-script initialization"); -#if SPICY_VERSION_NUMBER >= 10700 hilti::rt::executeManualPreInits(); -#endif autoDiscoverModules(); @@ -575,13 +567,7 @@ void Manager::InitPreScript() { // Returns a port's Zeek-side transport protocol. static ::TransportProto transport_protocol(const hilti::rt::Port port) { -#if SPICY_VERSION_NUMBER >= 10700 - auto proto = port.protocol().value(); -#else - auto proto = port.protocol(); -#endif - - switch ( proto ) { + switch ( port.protocol().value() ) { case hilti::rt::Protocol::TCP: return ::TransportProto::TRANSPORT_TCP; case hilti::rt::Protocol::UDP: return ::TransportProto::TRANSPORT_UDP; case hilti::rt::Protocol::ICMP: return ::TransportProto::TRANSPORT_ICMP; @@ -641,24 +627,17 @@ void Manager::InitPostScript() { hilti_config.cout.reset(); if ( id::find_const("Spicy::enable_profiling")->AsBool() ) -#if SPICY_VERSION_NUMBER >= 10800 hilti_config.enable_profiling = true; -#else - std::cerr << "Profiling is not supported with this version of Spicy, ignoring " - "'Spicy::enable_profiling'\n"; -#endif hilti_config.abort_on_exceptions = id::find_const("Spicy::abort_on_exceptions")->AsBool(); hilti_config.show_backtraces = id::find_const("Spicy::show_backtraces")->AsBool(); hilti::rt::configuration::set(hilti_config); -#if SPICY_VERSION_NUMBER >= 10700 auto spicy_config = ::spicy::rt::configuration::get(); spicy_config.hook_accept_input = hook_accept_input; spicy_config.hook_decline_input = hook_decline_input; ::spicy::rt::configuration::set(std::move(spicy_config)); -#endif try { ::hilti::rt::init(); @@ -822,11 +801,7 @@ void Manager::loadModule(const hilti::rt::filesystem::path& path) { else { SPICY_DEBUG(hilti::rt::fmt("Ignoring duplicate loading request for %s", canonical_path.native())); } -#if SPICY_VERSION_NUMBER >= 10700 } catch ( const ::hilti::rt::UsageError& e ) { -#else - } catch ( const ::hilti::rt::UserException& e ) { -#endif hilti::rt::fatalError(e.what()); } } diff --git a/src/spicy/spicy.bif b/src/spicy/spicy.bif index cb2c685a2e..1c8b38ab5f 100644 --- a/src/spicy/spicy.bif +++ b/src/spicy/spicy.bif @@ -53,9 +53,7 @@ function Spicy::__resource_usage%(%) : Spicy::ResourceUsage r->Assign(n++, ru.memory_heap); r->Assign(n++, ru.num_fibers); r->Assign(n++, ru.max_fibers); -#if SPICY_VERSION_NUMBER >= 10800 r->Assign(n++, ru.max_fiber_stack_size); -#endif r->Assign(n++, ru.cached_fibers); return r; diff --git a/src/spicy/spicyz/driver.cc b/src/spicy/spicyz/driver.cc index 99dec308fa..3cbd91d302 100644 --- a/src/spicy/spicyz/driver.cc +++ b/src/spicy/spicyz/driver.cc @@ -119,10 +119,8 @@ Driver::Driver(std::unique_ptr glue, const char* argv0, hilti::rt: config.preprocessor_constants["HAVE_ZEEK"] = 1; config.preprocessor_constants["ZEEK_VERSION"] = zeek_version; -#if SPICY_VERSION_NUMBER >= 10500 ::hilti::init(); ::spicy::init(); -#endif } Driver::~Driver() {} diff --git a/src/spicy/spicyz/glue-compiler.cc b/src/spicy/spicyz/glue-compiler.cc index d8e1defa24..c519084d0a 100644 --- a/src/spicy/spicyz/glue-compiler.cc +++ b/src/spicy/spicyz/glue-compiler.cc @@ -1011,14 +1011,8 @@ bool GlueCompiler::compile() { } } -#if SPICY_VERSION_NUMBER >= 10700 - auto proto = a.protocol.value(); -#else - auto proto = a.protocol; -#endif - hilti::ID protocol; - switch ( proto ) { + switch ( a.protocol.value() ) { case hilti::rt::Protocol::TCP: protocol = hilti::ID("hilti::Protocol::TCP"); break; case hilti::rt::Protocol::UDP: protocol = hilti::ID("hilti::Protocol::UDP"); break; default: hilti::logger().internalError("unexpected protocol"); diff --git a/src/spicy/spicyz/main.cc b/src/spicy/spicyz/main.cc index b2689600e7..0d30af174c 100644 --- a/src/spicy/spicyz/main.cc +++ b/src/spicy/spicyz/main.cc @@ -209,21 +209,11 @@ static hilti::Result parseOptions(int argc, char** argv, hilti::driver: } case 'Z': -#if SPICY_VERSION_NUMBER >= 10800 driver_options->enable_profiling = true; compiler_options->enable_profiling = true; -#else - std::cerr << "Profiling is not supported with this version of Spicy, ignoring '-Z'\n"; -#endif break; - case OPT_CXX_LINK: -#if SPICY_VERSION_NUMBER >= 10600 - compiler_options->cxx_link.emplace_back(optarg); -#else - return hilti::result::Error("option '--cxx-link' is only supported for Spicy 1.6 or newer"); -#endif - break; + case OPT_CXX_LINK: compiler_options->cxx_link.emplace_back(optarg); break; case 'h': usage(); return Nothing();