Skip to content

inline function in RivetONNXrt to avoid multiple definitions

tprocter46 requested to merge fix-rivetonnxrt-header into release-4-0-x

Not an issue that affected 4.0.0 - unless anyone was already getting so creative they were writing their own ONNX analyses and putting them in pluginONNX

At the moment, there are two (simple) function definitions (not just declarations) in RivetONNXrt.hh. This is fine as long as you only have one analysis in that directory, but as soon as you add another, they both include the header individually, and include guards don't save you from multiple definitions of functions when the build systems tries to compile both analyses into RivetONNXAnalyses.so

The easiest solution is to just inline the two functions -- voil`a.

(The alternatives are making a RivetONNXrt.cc, which would break all the simplicty of onnx only being required at analysis compile time, and make the build system even more complicated and if-elsey, or else making them static member functions of the RivetONNXrt class, which comes with adding ugly RivetONNXrt:: into the analysis codes)

Edited by tprocter46

Merge request reports