> On July 9, 2015, 2:46 a.m., Kapil Arya wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/version.hpp, line 36
> > <https://reviews.apache.org/r/36336/diff/1/?file=1002978#file1002978line36>
> >
> >     Why do we want to rename major/minor/patch to 
> > primary/secondary/tertiary? The former is a widely accepted format.
> 
> Paul Brett wrote:
>     g++ defines _GNU_SOURCE (required for libstdc++).  This #includes 
> sysmacros.h which #define major and minor as macros for makedev.
> 
> Ben Mahler wrote:
>     If you add major(), minor(), patch() as methods instead, does that bypass 
> the macro issue?
> 
> Paul Brett wrote:
>     No, that doesn't work.  At the calling site, x.major() gets expanded to 
> x.gnu_dev_major() by the macro.
> 
> Kapil Arya wrote:
>     Can we just `#undef` the macros for this file. AFAIK, we aren't using 
> them in the source code.
> 
> Paul Brett wrote:
>     We could but we would be doing that in a header file which would impact 
> everyone who might ever include stout version directly or indirectly.  How 
> about we use getMajor(), getMinor() and getPatch() accessor methods?

Per our chat, how about majorVersion(), minorVersion(), patchVersion() with a 
note for posterity?

With getMajor(), seems callers might still be likely to call their variable 
'major': `unsigned int major = version.getMajor()`


- Ben


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36336/#review91047
-----------------------------------------------------------


On July 8, 2015, 10:50 p.m., Paul Brett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36336/
> -----------------------------------------------------------
> 
> (Updated July 8, 2015, 10:50 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, Ian Downes, Jie Yu, 
> Kapil Arya, and Vinod Kone.
> 
> 
> Bugs: MESOS-3020
>     https://issues.apache.org/jira/browse/MESOS-3020
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Expose major, minor and patch components from stout Version
> 
> Note: The names major and minor are not available when compiling with GCC 
> because it pulls in the sysmacros.h header implicitly which define these for 
> makedev.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/version.hpp 
> 8692323d28131cd5706dde0503d49f8f0b0a1aeb 
> 
> Diff: https://reviews.apache.org/r/36336/diff/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Paul Brett
> 
>

Reply via email to