In similar situations, we have made a compatibility layer which can be dropped when support for 7 is dropped. Something like...
PluginAts7Compatibility.h #ifdef TS_VERSION_MAJOR <= 7 int TSHttpTxnStatusSet(...) { return TSHttpTxnSetHttpRetStatus(...); } #endif Then your plugin can use TSHttpTxnStatusSet in both versions. On Fri, Jan 4, 2019 at 7:55 PM Pushkar Pradhan <pprad...@oath.com.invalid> wrote: > It seems the API TSHttpTxnSetHttpRetStatus in 7.x was changed to > TSHttpTxnStatusSet in 8.x. > The underlying code seems to be the same, only the name has changed. > > I am writing a plugin that calls this function and that I want to work in > both 7.x and 8.x codelines. > I can wrap the names in a #iifdef like this: > > #ifdef TS_VERSION_MAJOR > 7 > TSHttpTxnStatusSet > #else > TSHttpTxnSetHttpRetStatus > #endif > > Would this be considered bad practice, any potential pitfalls to be aware > of? > Thanks, > -- > pushkar > -- Aaron Canary ATS - Senior Software Engineer