[PATCH 1/2 v2] version: Fix WESTON_VERSION_AT_LEAST macro

Eoff, Ullysses A ullysses.a.eoff at intel.com
Fri Jan 24 13:05:24 PST 2014


Even with just a rename, if the API/ABI doesn't change from 1.4.x to 1.5.x
the macro wouldn't work if you used WESTON_VERSION_COMPATIBLE_WITH(1,4,0)
when version == 1.5.0 as it's written now.

That is, with a rename, the logic indicates that "No major or minor
release is compatible with another major or minor release", regardless of
API/ABI changes.

> -----Original Message-----
> From: Daniel Stone [mailto:daniel at fooishbar.org]
> Sent: Friday, January 24, 2014 12:37 PM
> To: Eoff, Ullysses A
> Cc: wayland-devel at lists.freedesktop.org
> Subject: Re: [PATCH 1/2 v2] version: Fix WESTON_VERSION_AT_LEAST macro
> 
> Hi,
> The macro should really be called WESTON_VERSION_COMPATIBLE_WITH() -
> it's done that way specifically to allow breaking API/ABI at least
> every minor release.
> 
> Cheers,
> Daniel
> 
> On 24 January 2014 19:11, U. Artie Eoff <ullysses.a.eoff at intel.com> wrote:
> > From: "U. Artie Eoff" <ullysses.a.eoff at intel.com>
> >
> > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74023
> >
> > Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
> > ---
> >  src/version.h.in | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/version.h.in b/src/version.h.in
> > index 79dba45..e72fea8 100644
> > --- a/src/version.h.in
> > +++ b/src/version.h.in
> > @@ -30,8 +30,9 @@
> >
> >  /* Can be used like #if 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))
> > -
> > +       ((WESTON_VERSION_MAJOR != major) ?            \
> > +        (WESTON_VERSION_MAJOR > major) :            \
> > +        ((WESTON_VERSION_MINOR != minor) ?          \
> > +          (WESTON_VERSION_MINOR > minor) :          \
> > +          (WESTON_VERSION_MICRO >= micro)))
> >  #endif
> > --
> > 1.8.3.1
> >
> > _______________________________________________
> > 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