Christian,

> How does one conditionally compile code based on the API version? I was 
> looking for a compile time conditional I could then use #if's with, but I 
> can't seem to find one. A release version #define would work too, although 
> not be as nice as the per file semver one.
> 
> I did find these are generated:
> 
> #ifdef vl_api_version_tuple
> vl_api_version_tuple(ipsec.api, 3, 0, 0)
> #endif /* vl_api_version_tuple */
> 
> but I dont know how to utilize this during CPP in an #if conditional

that functions is used like this:
#define vl_api_version_tuple(n,mj, mi, p) \
  vl_msg_api_add_version (am, #n, mj, mi, p);
#include <vpp/api/vpe_all_api_h.h>
#undef vl_api_version_tuple

But if you want a simple define to use I can trivially add something like:
#define <MODULE>_SEMVER 1

Could go in <module>.api_types.h

Cheers,
Ole
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15607): https://lists.fd.io/g/vpp-dev/message/15607
Mute This Topic: https://lists.fd.io/mt/71604387/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to