Skip to content

Commit

Permalink
Fix compilation with API 17 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
gempa-jabe authored Jan 16, 2025
1 parent 2e43da6 commit 7b09dce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/seiscomp/processing/eewamps/preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


#include <seiscomp/logging/log.h>
#include <seiscomp/core/version.h>
#include <seiscomp/processing/operator/ncomps.h>
#include <seiscomp/io/records/mseedrecord.h>
#include <seiscomp/io/recordfilter/demux.h>
Expand Down Expand Up @@ -138,7 +139,11 @@ class StreamOperator : public NCompsOperator<double,N,PROC> {

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;
}
Expand All @@ -147,7 +152,11 @@ class StreamOperator : public NCompsOperator<double,N,PROC> {
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;
}
Expand Down

0 comments on commit 7b09dce

Please # to comment.