DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

version.h (950B)


      1 #pragma once
      2 
      3 #include "private/macros.h"
      4 #include "private/std.h"
      5 
      6 #ifdef __cplusplus
      7 extern "C" {
      8 #endif
      9 
     10 typedef struct clap_version {
     11    // This is the major ABI and API design
     12    // Version 0.X.Y correspond to the development stage, API and ABI are not stable
     13    // Version 1.X.Y correspont to the release stage, API and ABI are stable
     14    uint32_t major;
     15    uint32_t minor;
     16    uint32_t revision;
     17 } clap_version_t;
     18 
     19 #ifdef __cplusplus
     20 }
     21 #endif
     22 
     23 #define CLAP_VERSION_MAJOR ((uint32_t)1)
     24 #define CLAP_VERSION_MINOR ((uint32_t)1)
     25 #define CLAP_VERSION_REVISION ((uint32_t)1)
     26 #define CLAP_VERSION_INIT {CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION}
     27 
     28 static const CLAP_CONSTEXPR clap_version_t CLAP_VERSION = CLAP_VERSION_INIT;
     29 
     30 CLAP_NODISCARD static inline CLAP_CONSTEXPR bool
     31 clap_version_is_compatible(const clap_version_t v) {
     32    // versions 0.x.y were used during development stage and aren't compatible
     33    return v.major >= 1;
     34 }