|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2001-03-12 16:25:11
on 3/11/01 10:20 AM, David Abrahams at abrahams_at_[hidden] wrote:
> I agree with Dean on this one. Also, I think it's much less important that
> the #define be memnonic for the 3 parts of the version number than that it
> march steadily forward. We can always provide a header
> boost/release_version.hpp with memnonic constants like:
>
> #define BOOST_VERSION_1_21_0 0x0177
Did you make up that number, or is there a formula there? We would need a
convention, and have the numbers go up as you said.
I suggest that we could have both. The single number would be the one
developers would check against. The separate numbers would allow developers
to print out the version without decoding.
The header could go like:
//=========================================================================
// Standard Boost header blurb goes here
// Beman could put a revision history here, which would really be
// the release date of each Boost version. He has to remember to
// update this file before each official release. Maybe a tool
// could be written to do it?
// Past Boost versions, single-part
// (previous versions don't have constants)
#define BOOST_VERSION_1_21_1 0x0178
//...
#define BOOST_VERSION_2_1_0 0x0201
// Current Boost version, single-part
// (compare this with the ones above, if needed)
#define BOOST_VERSION_CURRENT BOOST_VERSION_2_1_0
// Current Boost version, multiple-parts
// (for display only; not for comparisons)
#define BOOST_VERSION_MAJOR 2
#define BOOST_VERSION_MINOR 1
#define BOOST_VERSION_FIX 0
//=========================================================================
I guess it could be used like (excuse any line-wrapping my e-mailer does):
//=========================================================================
#include <boost/release_version.hpp>
#if defined(BOOST_VERSION_1_23_0) && (BOOST_VERSION_CURRENT >
BOOST_VERSION_1_23_0)
#include <boost/crc.hpp> // Boost 1.23.0's version had a bug
#else
#include <custom/crc_code.hpp>
#endif
//...
int main()
{
//...
cout << "Using Boost " << BOOST_VERSION_MAJOR << '.'
<< BOOST_VERSION_MINOR << '.' << BOOST_VERSION_FIX << ".\n";
//...
}
//=========================================================================
> ----- Original Message -----
> From: <deansturtevant_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Sunday, March 11, 2001 9:49 AM
> Subject: [boost] Re: Version #defines?
>
>
>> --- In boost_at_y..., Daryle Walker <darylew_at_m...> wrote:
>>> Should we add #defines for the current Boost version? They probably would
>>> go in "config.hpp". They could go something like:
>>>
>>> //===================================
>>> #define BOOST_VERSION_MAJOR 1
>>> #define BOOST_VERSION_MINOR 21
>>> #define BOOST_VERSION_FIX 0
>>> //===================================
>> Based on recent experience looking at code which tests for the minor version
>> of the GCC compiler without testing for the major version, I think separating
>> out major from minor in #defines is not a good idea. How about a single
>> version number?
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk