From 7b09dcee4ef99656c0672c0899773e80f3aa6598 Mon Sep 17 00:00:00 2001 From: Jan Becker Date: Thu, 16 Jan 2025 12:14:23 +0100 Subject: [PATCH] Fix compilation with API 17 (#68) --- libs/seiscomp/processing/eewamps/preprocessor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/seiscomp/processing/eewamps/preprocessor.cpp b/libs/seiscomp/processing/eewamps/preprocessor.cpp index ed36269..4431614 100644 --- a/libs/seiscomp/processing/eewamps/preprocessor.cpp +++ b/libs/seiscomp/processing/eewamps/preprocessor.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -138,7 +139,11 @@ class StreamOperator : public NCompsOperator { bool hasCommonEndTime = true; for ( int i = 0; i < N; ++i ) { +#if SC_API_VERSION < SC_API_VERSION_CHECK(17,0,0) if ( !this->_states[i].endTime.valid() ) { +#else + if ( !this->_states[i].endTime ) { +#endif hasCommonEndTime = false; break; } @@ -147,7 +152,11 @@ class StreamOperator : public NCompsOperator { if ( hasCommonEndTime ) { for ( int i = 0; i < N; ++i ) { if ( this->_states[i].buffer.empty() ) continue; +#if SC_API_VERSION < SC_API_VERSION_CHECK(17,0,0) Core::TimeSpan delay = this->_states[i].buffer.back()->endTime() - this->_states[i].endTime; +#else + Core::TimeSpan delay = this->_states[i].buffer.back()->endTime() - *this->_states[i].endTime; +#endif if ( delay > _currentDelay ) _currentDelay = delay; }