[PATCH] version.h: Add version check macro

Kristian Høgsberg hoegsberg at gmail.com
Tue Sep 24 11:05:27 PDT 2013


On Tue, Sep 24, 2013 at 12:54 AM, Marc Chalain <marc.chalain at gmail.com> wrote:
> But the WESTON_VERSION_AT_LEAST macro is wrong. You can check only the minor
> and not the rest of the version.

No, we don't guarantee plugin API stability between x.y releases, only
micro releases 1.2.x maintain that interface.  Something developed for
1.1.2 isn't guaranteed to work on 1.2.1, but anything written against
1.2.1 will work on 1.2.2 and later 1.2.x releases.

Kristian

> 2013/9/23 Kristian Høgsberg <hoegsberg at gmail.com>
>>
>> On Mon, Sep 23, 2013 at 10:39:08AM -0700, Kristian Høgsberg wrote:
>> > On Mon, Sep 23, 2013 at 07:26:03AM +0200, Pier Luigi Fiorini wrote:
>> > > Make it easier to check for a Weston version.
>> >
>> > Ah yup, I lost track of that one.  Thanks, committed.
>> >
>> > Kristian
>> >
>> > > ---
>> > >  src/version.h.in | 12 +++++++++++-
>> > >  1 file changed, 11 insertions(+), 1 deletion(-)
>> > >
>> > > diff --git a/src/version.h.in b/src/version.h.in
>> > > index f573328..d45172c 100644
>> > > --- a/src/version.h.in
>> > > +++ b/src/version.h.in
>> > > @@ -26,6 +26,16 @@
>> > >  #define WESTON_VERSION_MAJOR @WESTON_VERSION_MAJOR@
>> > >  #define WESTON_VERSION_MINOR @WESTON_VERSION_MINOR@
>> > >  #define WESTON_VERSION_MICRO @WESTON_VERSION_MICRO@
>> > > -#define WESTON_VERSION "@WESTON_VERSION@"
>> > > +
>> > > +#define WESTON_VERSION ((WESTON_VERSION_MAJOR << 16) |
>> > > (WESTON_VERSION_MINOR << 8) | (WESTON_VERSION_MICRO))
>> > > +#define WESTON_VERSION_STR "@WESTON_VERSION@"
>> > > +
>> > > +/*
>> > > +    Can be used like #if (WESTON_VERSION >=
>> > > WESTON_VERSION_AT_LEAST(1, 2, 0))
>> > > +*/
>> > > +#define WESTON_VERSION_AT_LEAST(major, minor, micro) \
>> > > +        (WESTON_VERSION_MAJOR == (major) && \
>> > > +         WESTON_VERSION_MINOR == (minor) && \
>> > > +         WESTON_VERSION_MICRO >= (micro))
>>
>> Actually, I trimmed the patch to be just the WESTON_VERSION_AT_LEAST
>> macro.  WESTON_VERSION is still the version string and I updated the
>> comment to say
>>
>>         /* Can be used like #if WESTON_VERSION_AT_LEAST(1, 2, 0) */
>>
>> Kristian
>>
>> > >
>> > >  #endif
>> > > --
>> > > 1.8.3.1
>> > >
>> > > _______________________________________________
>> > > wayland-devel mailing list
>> > > wayland-devel at lists.freedesktop.org
>> > > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
>


More information about the wayland-devel mailing list