You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Zhitao Li <zh...@gmail.com> on 2016/08/11 17:51:03 UTC

Integer version macro in header for conditional compilation

Hi all,

I sent a review request https://reviews.apache.org/r/50992/ to change the
MAJOR/MINOR/PATCH version macro in version.hpp to be integer rather than
string, so module writers can perform easier version comparison during
conditional compilation.

These macros are not directly referred in mesos codebase itself.

Can anyone who has a module which already refers these macros let us know
whether this can break existing builds?

Thanks!

-- 
Cheers,

Zhitao Li

Re: Integer version macro in header for conditional compilation

Posted by Zhitao Li <zh...@gmail.com>.
Hi all,

Yan has helped to commit https://reviews.apache.org/r/50992/. After its
release (scheduled in 1.1.0), if you need conditional compilation in your
module based on version, you should be able to do something like:

```

#ifdef MESOS_MAJOR_VERSION_NUM
#if MESOS_MAJOR_VERSION_NUM >= 1
......
#endif
#endif


```

The above samples shows if you are using code which only compiles after
Mesos 1.0.

Please let me know if you have more questions.

Cheers,

Zhitao Li

On Thu, Aug 11, 2016 at 12:25 PM, Vinod Kone <vi...@apache.org> wrote:

> +kapil,till,adam
>
> On Thu, Aug 11, 2016 at 10:51 AM, Zhitao Li <zh...@gmail.com> wrote:
>
> > Hi all,
> >
> > I sent a review request https://reviews.apache.org/r/50992/ to change
> the
> > MAJOR/MINOR/PATCH version macro in version.hpp to be integer rather than
> > string, so module writers can perform easier version comparison during
> > conditional compilation.
> >
> > These macros are not directly referred in mesos codebase itself.
> >
> > Can anyone who has a module which already refers these macros let us know
> > whether this can break existing builds?
> >
> > Thanks!
> >
> > --
> > Cheers,
> >
> > Zhitao Li
> >
>



-- 
Cheers,

Zhitao Li

Re: Integer version macro in header for conditional compilation

Posted by Zhitao Li <zh...@gmail.com>.
Hi all,

Yan has helped to commit https://reviews.apache.org/r/50992/. After its
release (scheduled in 1.1.0), if you need conditional compilation in your
module based on version, you should be able to do something like:

```

#ifdef MESOS_MAJOR_VERSION_NUM
#if MESOS_MAJOR_VERSION_NUM >= 1
......
#endif
#endif


```

The above samples shows if you are using code which only compiles after
Mesos 1.0.

Please let me know if you have more questions.

Cheers,

Zhitao Li

On Thu, Aug 11, 2016 at 12:25 PM, Vinod Kone <vi...@apache.org> wrote:

> +kapil,till,adam
>
> On Thu, Aug 11, 2016 at 10:51 AM, Zhitao Li <zh...@gmail.com> wrote:
>
> > Hi all,
> >
> > I sent a review request https://reviews.apache.org/r/50992/ to change
> the
> > MAJOR/MINOR/PATCH version macro in version.hpp to be integer rather than
> > string, so module writers can perform easier version comparison during
> > conditional compilation.
> >
> > These macros are not directly referred in mesos codebase itself.
> >
> > Can anyone who has a module which already refers these macros let us know
> > whether this can break existing builds?
> >
> > Thanks!
> >
> > --
> > Cheers,
> >
> > Zhitao Li
> >
>



-- 
Cheers,

Zhitao Li

Re: Integer version macro in header for conditional compilation

Posted by Vinod Kone <vi...@apache.org>.
+kapil,till,adam

On Thu, Aug 11, 2016 at 10:51 AM, Zhitao Li <zh...@gmail.com> wrote:

> Hi all,
>
> I sent a review request https://reviews.apache.org/r/50992/ to change the
> MAJOR/MINOR/PATCH version macro in version.hpp to be integer rather than
> string, so module writers can perform easier version comparison during
> conditional compilation.
>
> These macros are not directly referred in mesos codebase itself.
>
> Can anyone who has a module which already refers these macros let us know
> whether this can break existing builds?
>
> Thanks!
>
> --
> Cheers,
>
> Zhitao Li
>

Re: Integer version macro in header for conditional compilation

Posted by Vinod Kone <vi...@apache.org>.
+kapil,till,adam

On Thu, Aug 11, 2016 at 10:51 AM, Zhitao Li <zh...@gmail.com> wrote:

> Hi all,
>
> I sent a review request https://reviews.apache.org/r/50992/ to change the
> MAJOR/MINOR/PATCH version macro in version.hpp to be integer rather than
> string, so module writers can perform easier version comparison during
> conditional compilation.
>
> These macros are not directly referred in mesos codebase itself.
>
> Can anyone who has a module which already refers these macros let us know
> whether this can break existing builds?
>
> Thanks!
>
> --
> Cheers,
>
> Zhitao Li
>