mirror of
https://github.com/boostorg/predef.git
synced 2025-07-29 11:37:13 +02:00
Use epoc date as basis for standards, c, c++, etc. version number.
This commit is contained in:
@ -19,7 +19,7 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
[table
|
[table
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
[[__predef_symbol__] [__predef_version__]]
|
||||||
|
|
||||||
[[``] [__predef_detection__]]
|
[[`__OBJC__`] [__predef_detection__]]
|
||||||
|
|
||||||
[[``] [V.R.P]]
|
[[``] [V.R.P]]
|
||||||
]
|
]
|
||||||
|
@ -15,14 +15,14 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
[heading `BOOST_LANG_STDC`]
|
[heading `BOOST_LANG_STDC`]
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/C_(programming_language) Standard C] language.
|
[@http://en.wikipedia.org/wiki/C_(programming_language) Standard C] language.
|
||||||
If available, the year of the standard is detected as YYYY.1.1 from the Epoc date.
|
If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
|
||||||
|
|
||||||
[table
|
[table
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
[[__predef_symbol__] [__predef_version__]]
|
||||||
|
|
||||||
[[``] [__predef_detection__]]
|
[[`__STDC__`] [__predef_detection__]]
|
||||||
|
|
||||||
[[``] [V.R.P]]
|
[[`__STDC_VERSION__`] [V.R.P]]
|
||||||
]
|
]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ If available, the year of the standard is detected as YYYY.1.1 from the Epoc dat
|
|||||||
# undef BOOST_LANG_STDC
|
# undef BOOST_LANG_STDC
|
||||||
# if defined(__STDC_VERSION__)
|
# if defined(__STDC_VERSION__)
|
||||||
# if (__STDC_VERSION__ > 100)
|
# if (__STDC_VERSION__ > 100)
|
||||||
# define BOOST_LANG_STDC BOOST_PREDEF_MAKE_YYYY(__STDC_VERSION__)
|
# define BOOST_LANG_STDC BOOST_PREDEF_MAKE_YYYYMM(__STDC_VERSION__)
|
||||||
# else
|
# else
|
||||||
# define BOOST_LANG_STDC BOOST_VERSION_NUMBER(0,0,1)
|
# define BOOST_LANG_STDC BOOST_VERSION_NUMBER(0,0,1)
|
||||||
# endif
|
# endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright Redshift Software Inc. 2011-2012
|
Copyright Redshift Software Inc. 2011-2013
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
(See accompanying file LICENSE_1_0.txt or copy at
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -22,10 +22,8 @@ Specifically the defined versions are:
|
|||||||
|
|
||||||
[table Detected Version Number vs. C++ Standard Year
|
[table Detected Version Number vs. C++ Standard Year
|
||||||
[[Detected Version Number] [Standard Year] [C++ Standard]]
|
[[Detected Version Number] [Standard Year] [C++ Standard]]
|
||||||
[[0.0.1997] [1998] [ISO/IEC 14882:1998]]
|
[[27.11.1] [1998] [ISO/IEC 14882:1998]]
|
||||||
[[0.0.?] [2003] [ISO/IEC 14882:2003]]
|
[[41.12.1] [2011] [ISO/IEC 14882:2011]]
|
||||||
[[0.0.?] [2007] [ISO/IEC TR 19768:2007]]
|
|
||||||
[[0.0.2011] [2011] [ISO/IEC 14882:2011]]
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[table
|
[table
|
||||||
@ -42,7 +40,7 @@ Specifically the defined versions are:
|
|||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
# undef BOOST_LANG_STDCPP
|
# undef BOOST_LANG_STDCPP
|
||||||
# if (__cplusplus > 100)
|
# if (__cplusplus > 100)
|
||||||
# define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER(0,0,__cplusplus/100)
|
# define BOOST_LANG_STDCPP BOOST_PREDEF_MAKE_YYYYMM(__cplusplus)
|
||||||
# else
|
# else
|
||||||
# define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER(0,0,1)
|
# define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER(0,0,1)
|
||||||
# endif
|
# endif
|
||||||
@ -58,7 +56,7 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPP,BOOST_LANG_STDCPP_NAME)
|
|||||||
[heading `BOOST_LANG_STDCPPCLI`]
|
[heading `BOOST_LANG_STDCPPCLI`]
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/C%2B%2B/CLI Standard C++/CLI] language.
|
[@http://en.wikipedia.org/wiki/C%2B%2B/CLI Standard C++/CLI] language.
|
||||||
If available, the year of the standard is detected as 0.0.YYYY.
|
If available, the year of the standard is detected as YYYY.MM.1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER(0,0,0)
|
#define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER(0,0,0)
|
||||||
@ -66,7 +64,7 @@ If available, the year of the standard is detected as 0.0.YYYY.
|
|||||||
#if defined(__cplusplus_cli)
|
#if defined(__cplusplus_cli)
|
||||||
# undef BOOST_LANG_STDCPPCLI
|
# undef BOOST_LANG_STDCPPCLI
|
||||||
# if (__cplusplus_cli > 100)
|
# if (__cplusplus_cli > 100)
|
||||||
# define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER(0,0,__cplusplus_cli/100)
|
# define BOOST_LANG_STDCPPCLI BOOST_PREDEF_MAKE_YYYYMM(__cplusplus_cli)
|
||||||
# else
|
# else
|
||||||
# define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER(0,0,1)
|
# define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER(0,0,1)
|
||||||
# endif
|
# endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright Redshift Software, Inc. 2008-2012
|
Copyright Redshift Software, Inc. 2008-2013
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
(See accompanying file LICENSE_1_0.txt or copy at
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -81,5 +81,7 @@ If the day is not available, but the month is, the 1st of the month is used as t
|
|||||||
#define BOOST_PREDEF_MAKE_YYYYMMDD(V) BOOST_PREDEF_MAKE_DATE(((V)/10000)%10000,((V)/100)%100,(V)%100)
|
#define BOOST_PREDEF_MAKE_YYYYMMDD(V) BOOST_PREDEF_MAKE_DATE(((V)/10000)%10000,((V)/100)%100,(V)%100)
|
||||||
/*` `BOOST_PREDEF_MAKE_YYYY(V)` */
|
/*` `BOOST_PREDEF_MAKE_YYYY(V)` */
|
||||||
#define BOOST_PREDEF_MAKE_YYYY(V) BOOST_PREDEF_MAKE_DATE(V,1,1)
|
#define BOOST_PREDEF_MAKE_YYYY(V) BOOST_PREDEF_MAKE_DATE(V,1,1)
|
||||||
|
/*` `BOOST_PREDEF_MAKE_YYYYMM(V)` */
|
||||||
|
#define BOOST_PREDEF_MAKE_YYYYMM(V) BOOST_PREDEF_MAKE_DATE((V)/100,(V),1)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright Redshift Software Inc 2011-2012
|
Copyright Redshift Software Inc 2011-2013
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
Distributed under the Boost Software License, Version 1.0.
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
(See accompanying file LICENSE_1_0.txt or copy at
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -51,9 +51,13 @@ void test_BOOST_VERSION_NUMBER()
|
|||||||
PREDEF_CHECK(BOOST_PREDEF_MAKE_10_VVRR0PPPP(999909999) == BOOST_VERSION_NUMBER(99,99,9999));
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_10_VVRR0PPPP(999909999) == BOOST_VERSION_NUMBER(99,99,9999));
|
||||||
PREDEF_CHECK(BOOST_PREDEF_MAKE_10_VRR(999) == BOOST_VERSION_NUMBER(9,99,00));
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_10_VRR(999) == BOOST_VERSION_NUMBER(9,99,00));
|
||||||
|
|
||||||
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_DATE(1971,1,1) == BOOST_VERSION_NUMBER(1,1,1));
|
||||||
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMMDD(19700101) == BOOST_VERSION_NUMBER(0,1,1));
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMMDD(19700101) == BOOST_VERSION_NUMBER(0,1,1));
|
||||||
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMMDD(19710101) == BOOST_VERSION_NUMBER(1,1,1));
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMMDD(19710101) == BOOST_VERSION_NUMBER(1,1,1));
|
||||||
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMMDD(20691231) == BOOST_VERSION_NUMBER(99,12,31));
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMMDD(20691231) == BOOST_VERSION_NUMBER(99,12,31));
|
||||||
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMM(197001) == BOOST_VERSION_NUMBER(0,1,1));
|
||||||
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMM(197101) == BOOST_VERSION_NUMBER(1,1,1));
|
||||||
|
PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYYMM(206912) == BOOST_VERSION_NUMBER(99,12,1));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
Reference in New Issue
Block a user