From 5513bc2b02731c5b923f0bafe350261efad260ad Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 19 Nov 2011 03:46:41 +0000 Subject: [PATCH] Major cleanup and update, although still in progress. Now contains tests for all predefs and utility macros. And added language predefs. git-svn-id: http://svn.boost.org/svn/boost/sandbox/predef@75548 b8fc166d-592f-0410-95f2-cb63ce0dd405 --- boost/predef.h | 6 +- boost/predef/architecture.h | 19 ++- boost/predef/architecture/alpha.h | 14 +- boost/predef/architecture/amd64.h | 13 +- boost/predef/architecture/arm.h | 13 +- boost/predef/architecture/convex.h | 43 +++++ boost/predef/architecture/ia64.h | 16 +- boost/predef/architecture/m68k.h | 35 ++-- boost/predef/architecture/mips.h | 13 +- boost/predef/architecture/parisc.h | 19 ++- boost/predef/architecture/ppc.h | 17 +- boost/predef/architecture/pyramid.h | 30 ++++ boost/predef/architecture/rs6k.h | 13 +- boost/predef/architecture/sparc.h | 19 ++- boost/predef/architecture/superh.h | 30 ++-- boost/predef/architecture/sys370.h | 13 +- boost/predef/architecture/sys390.h | 13 +- boost/predef/architecture/x86.h | 34 +++- boost/predef/architecture/z.h | 12 +- boost/predef/compiler.h | 2 +- boost/predef/compiler/borland.h | 7 +- boost/predef/compiler/comeau.h | 7 +- boost/predef/compiler/compaq.h | 5 +- boost/predef/compiler/cygwin.h | 5 +- boost/predef/compiler/diab.h | 9 +- boost/predef/compiler/digitalmars.h | 7 +- boost/predef/compiler/dignus.h | 7 +- boost/predef/compiler/edg.h | 7 +- boost/predef/compiler/ekopath.h | 5 +- boost/predef/compiler/gcc.h | 5 +- boost/predef/compiler/gcc_xml.h | 5 +- boost/predef/compiler/greenhills.h | 7 +- boost/predef/compiler/hp_acc.h | 7 +- boost/predef/compiler/iar.h | 7 +- boost/predef/compiler/ibm.h | 11 +- boost/predef/compiler/intel.h | 7 +- boost/predef/compiler/kai.h | 7 +- boost/predef/compiler/llvm.h | 5 +- boost/predef/compiler/metaware.h | 5 +- boost/predef/compiler/metrowerks.h | 7 +- boost/predef/compiler/microtec.h | 5 +- boost/predef/compiler/mingw.h | 5 +- boost/predef/compiler/mpw.h | 7 +- boost/predef/compiler/palm.h | 7 +- boost/predef/compiler/pgi.h | 5 +- boost/predef/compiler/sgi_mipspro.h | 9 +- boost/predef/compiler/sunpro.h | 7 +- boost/predef/compiler/tendra.h | 5 +- boost/predef/compiler/visualc.h | 5 +- boost/predef/compiler/watcom.h | 7 +- boost/predef/detail/_cassert.h | 17 ++ boost/predef/detail/_exception.h | 15 ++ boost/predef/detail/test.h | 17 ++ boost/predef/detail/vrp.h | 32 ---- boost/predef/language.h | 15 ++ boost/predef/language/objc.h | 30 ++++ boost/predef/language/stdc.h | 39 +++++ boost/predef/language/stdcpp.h | 72 ++++++++ boost/predef/library/c.h | 2 +- boost/predef/library/c/gnu.h | 12 +- boost/predef/library/c/uc.h | 5 +- boost/predef/library/c/vms.h | 5 +- boost/predef/library/c/zos.h | 7 +- boost/predef/library/std.h | 6 +- boost/predef/library/std/dinkumware.h | 7 +- boost/predef/library/std/libcomo.h | 5 +- boost/predef/library/std/modena.h | 5 +- boost/predef/library/std/msl.h | 9 +- boost/predef/library/std/roguewave.h | 9 +- boost/predef/library/std/sgi.h | 7 +- boost/predef/library/std/stdcpp3.h | 11 +- boost/predef/library/std/stlport.h | 9 +- boost/predef/library/std/vacpp.h | 5 +- boost/predef/make.h | 72 ++++++++ boost/predef/os/aix.h | 9 +- boost/predef/os/amigaos.h | 9 +- boost/predef/os/beos.h | 9 +- boost/predef/os/bsd.h | 19 ++- boost/predef/os/cygwin.h | 9 +- boost/predef/os/hpux.h | 9 +- boost/predef/os/irix.h | 9 +- boost/predef/os/linux.h | 9 +- boost/predef/os/macos.h | 9 +- boost/predef/os/qnxnto.h | 11 +- boost/predef/os/solaris.h | 9 +- boost/predef/os/unix.h | 9 +- boost/predef/os/windows.h | 9 +- boost/predef/version_number.h | 33 +++- jamroot.jam | 10 ++ libs/predef/doc/build.jam | 38 +++++ libs/predef/doc/predef.qbk | 236 ++++++++++++++++++++++++++ libs/predef/test/build.jam | 19 +++ libs/predef/test/info_as_c.c | 76 +++++++++ libs/predef/test/info_as_cpp.cpp | 90 ++++++++++ libs/predef/test/info_as_objc.m | 7 + libs/predef/test/info_as_objcpp.mm | 7 + libs/predef/test/make.cpp | 78 +++++++++ libs/predef/test/version.cpp | 62 +++++++ 98 files changed, 1538 insertions(+), 228 deletions(-) create mode 100644 boost/predef/architecture/convex.h create mode 100644 boost/predef/architecture/pyramid.h create mode 100644 boost/predef/detail/_cassert.h create mode 100644 boost/predef/detail/_exception.h create mode 100644 boost/predef/detail/test.h delete mode 100644 boost/predef/detail/vrp.h create mode 100644 boost/predef/language.h create mode 100644 boost/predef/language/objc.h create mode 100644 boost/predef/language/stdc.h create mode 100644 boost/predef/language/stdcpp.h create mode 100644 boost/predef/make.h create mode 100644 jamroot.jam create mode 100644 libs/predef/doc/build.jam create mode 100644 libs/predef/doc/predef.qbk create mode 100644 libs/predef/test/build.jam create mode 100644 libs/predef/test/info_as_c.c create mode 100644 libs/predef/test/info_as_cpp.cpp create mode 100644 libs/predef/test/info_as_objc.m create mode 100644 libs/predef/test/info_as_objcpp.mm create mode 100644 libs/predef/test/make.cpp create mode 100644 libs/predef/test/version.cpp diff --git a/boost/predef.h b/boost/predef.h index bc80519..f26f9a6 100644 --- a/boost/predef.h +++ b/boost/predef.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -8,8 +8,10 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_H #define BOOST_PREDEF_H +#include +#include #include #include -#include +#include #endif diff --git a/boost/predef/architecture.h b/boost/predef/architecture.h index ee14368..666d501 100644 --- a/boost/predef/architecture.h +++ b/boost/predef/architecture.h @@ -8,6 +8,23 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_ARCHITECTURE_H #define BOOST_PREDEF_ARCHITECTURE_H -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include #endif diff --git a/boost/predef/architecture/alpha.h b/boost/predef/architecture/alpha.h index 35939c3..f25bc46 100644 --- a/boost/predef/architecture/alpha.h +++ b/boost/predef/architecture/alpha.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,14 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_ALPHA_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_ALPHA`] + +[@http://en.wikipedia.org/wiki/DEC_Alpha DEC Alpha] architecture: +If available versions [4-6] are specifically detected. + */ #define BOOST_ARCHITECTURE_ALPHA BOOST_VERSION_NUMBER(0,0,0) @@ -27,4 +34,7 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_ALPHA,"DEC Alpha") + #endif diff --git a/boost/predef/architecture/amd64.h b/boost/predef/architecture/amd64.h index 6a31b14..e05d31e 100644 --- a/boost/predef/architecture/amd64.h +++ b/boost/predef/architecture/amd64.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_AMD64_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_AMD64`] + +[@http://en.wikipedia.org/wiki/Amd64 American Micro Devices AMD 64] architecture. + */ #define BOOST_ARCHITECTURE_AMD64 BOOST_VERSION_NUMBER(0,0,0) @@ -20,4 +26,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCHITECTURE_AMD64 BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_AMD64,"American Micro Devices AMD 64") + #endif diff --git a/boost/predef/architecture/arm.h b/boost/predef/architecture/arm.h index aa7e477..d4170e1 100644 --- a/boost/predef/architecture/arm.h +++ b/boost/predef/architecture/arm.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_ARM_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_ARM`] + +[@http://en.wikipedia.org/wiki/ARM_architecture ARM] architecture. + */ #define BOOST_ARCHITECTURE_ARM BOOST_VERSION_NUMBER(0,0,0) @@ -25,4 +31,7 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_ARM,"ARM") + #endif diff --git a/boost/predef/architecture/convex.h b/boost/predef/architecture/convex.h new file mode 100644 index 0000000..e11dcb3 --- /dev/null +++ b/boost/predef/architecture/convex.h @@ -0,0 +1,43 @@ +/* +Copyright Redshift Software Inc 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_ARCHITECTURE_CONVEX_H +#define BOOST_PREDEF_ARCHITECTURE_CONVEX_H + +#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_CONVEX`] + +[@http://en.wikipedia.org/wiki/Convex_Computer Convex Computer] architecture. + */ + +#define BOOST_ARCHITECTURE_CONVEX BOOST_VERSION_NUMBER(0,0,0) + +#if defined(__convex__) + #undef BOOST_ARCHITECTURE_CONVEX + #if defined(__convex_c1__) + #define BOOST_ARCHITECTURE_CONVEX BOOST_VERSION_NUMBER(1,0,0) + #elif defined(__convex_c2__) + #define BOOST_ARCHITECTURE_CONVEX BOOST_VERSION_NUMBER(2,0,0) + #elif defined(__convex_c32__) + #define BOOST_ARCHITECTURE_CONVEX BOOST_VERSION_NUMBER(3,2,0) + #elif defined(__convex_c34__) + #define BOOST_ARCHITECTURE_CONVEX BOOST_VERSION_NUMBER(3,4,0) + #elif defined(__convex_c38__) + #define BOOST_ARCHITECTURE_CONVEX BOOST_VERSION_NUMBER(3,8,0) + #else + #define BOOST_ARCHITECTURE_CONVEX BOOST_VERSION_NUMBER(0,0,1) + #endif +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_CONVEX,"Convex Computer") + + +#endif diff --git a/boost/predef/architecture/ia64.h b/boost/predef/architecture/ia64.h index cbabef5..d46eb13 100644 --- a/boost/predef/architecture/ia64.h +++ b/boost/predef/architecture/ia64.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,15 +9,25 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_IA64_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_IA64`] + +[@http://en.wikipedia.org/wiki/Ia64 Intel IA-64] architecture. + */ #define BOOST_ARCHITECTURE_IA64 BOOST_VERSION_NUMBER(0,0,0) #if defined(__ia64__) || defined(_IA64) || \ defined(__IA64__) || defined(__ia64) || \ - defined(_M_IA64) + defined(_M_IA64) || defined(__itanium__) || \ + defined(__x86_64) || defined(__x86_64__) #undef BOOST_ARCHITECTURE_IA64 #define BOOST_ARCHITECTURE_IA64 BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_IA64,"Intel IA-64") + #endif diff --git a/boost/predef/architecture/m68k.h b/boost/predef/architecture/m68k.h index 0669976..9ec7d1c 100644 --- a/boost/predef/architecture/m68k.h +++ b/boost/predef/architecture/m68k.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,27 +9,36 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_M68K_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_M68K`] + +[@http://en.wikipedia.org/wiki/M68k Motorola 68k] architecture. + */ #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(0,0,0) #if defined(__m68k__) || defined(M68000) #undef BOOST_ARCHITECTURE_M68K - #if defined(__mc68000__) - #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(0,0,1) - #elif defined(__mc68010__) - #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(1,0,0) - #elif defined(__mc68020__) - #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(2,0,0) - #elif defined(__mc68030__) - #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(3,0,0) - #elif defined(__mc68040__) - #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(4,0,0) - #elif defined(__mc68060__) + #if defined(__mc68060__) || defined(mc68060) || defined(__mc68060) #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(6,0,0) + #elif defined(__mc68040__) || defined(mc68040) || defined(__mc68040) + #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(4,0,0) + #elif defined(__mc68030__) || defined(mc68030) || defined(__mc68030) + #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(3,0,0) + #elif defined(__mc68020__) || defined(mc68020) || defined(__mc68020) + #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(2,0,0) + #elif defined(__mc68010__) || defined(mc68010) || defined(__mc68010) + #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(1,0,0) + #elif defined(__mc68000__) || defined(mc68000) || defined(__mc68000) + #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(0,0,1) #else #define BOOST_ARCHITECTURE_M68K BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_M68K,"Motorola 68k") + #endif diff --git a/boost/predef/architecture/mips.h b/boost/predef/architecture/mips.h index 6908b2b..01433e7 100644 --- a/boost/predef/architecture/mips.h +++ b/boost/predef/architecture/mips.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_MIPS_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_MIPS`] + +[@http://en.wikipedia.org/wiki/MIPS_architecture MIPS] architecture. + */ #define BOOST_ARCHITECTURE_MIPS BOOST_VERSION_NUMBER(0,0,0) @@ -31,4 +37,7 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_MIPS,"MIPS") + #endif diff --git a/boost/predef/architecture/parisc.h b/boost/predef/architecture/parisc.h index e00ae76..0781b72 100644 --- a/boost/predef/architecture/parisc.h +++ b/boost/predef/architecture/parisc.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,21 +9,30 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_PARISC_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_PARISK`] + +[@http://en.wikipedia.org/wiki/PA-RISC_family HP/PA RISC] architecture. + */ #define BOOST_ARCHITECTURE_PARISC BOOST_VERSION_NUMBER(0,0,0) -#if defined(__hppa__) || defined(__hppa) +#if defined(__hppa__) || defined(__hppa) || defined(__HPPA__) #undef BOOST_ARCHITECTURE_PARISC #if defined(_PA_RISC1_0) #define BOOST_ARCHITECTURE_PARISC BOOST_VERSION_NUMBER(1,0,0) - #elif defined(_PA_RISC1_1) + #elif defined(_PA_RISC1_1) || defined(__HPPA11__) || defined(__PA7100__) #define BOOST_ARCHITECTURE_PARISC BOOST_VERSION_NUMBER(1,1,0) - #elif defined(_PA_RISC2_0) + #elif defined(_PA_RISC2_0) || defined(__RISC2_0__) || defined(__HPPA20__) || defined(__PA8000__) #define BOOST_ARCHITECTURE_PARISC BOOST_VERSION_NUMBER(2,0,0) #else #define BOOST_ARCHITECTURE_PARISC BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_PARISC,"HP/PA RISC") + #endif diff --git a/boost/predef/architecture/ppc.h b/boost/predef/architecture/ppc.h index 73c0b8b..76cb272 100644 --- a/boost/predef/architecture/ppc.h +++ b/boost/predef/architecture/ppc.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,13 +9,21 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_PPC_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_PPC`] + +[@http://en.wikipedia.org/wiki/PowerPC PowerPC] architecture. + */ #define BOOST_ARCHITECTURE_PPC BOOST_VERSION_NUMBER(0,0,0) #if defined(__powerpc) || defined(__powerpc__) || \ defined(__POWERPC__) || defined(__ppc__) || \ - defined(_M_PPC) || defined(_ARCH_PPC) + defined(_M_PPC) || defined(_ARCH_PPC) || \ + defined(__PPCGECKO__) || defined(__PPCBROADWAY__) || \ + defined(_XENON) #undef BOOST_ARCHITECTURE_PPC #if defined(__ppc601__) || defined(_ARCH_601) #define BOOST_ARCHITECTURE_PPC BOOST_VERSION_NUMBER(6,1,0) @@ -28,4 +36,7 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_PPC,"PowerPC") + #endif diff --git a/boost/predef/architecture/pyramid.h b/boost/predef/architecture/pyramid.h new file mode 100644 index 0000000..6f6825d --- /dev/null +++ b/boost/predef/architecture/pyramid.h @@ -0,0 +1,30 @@ +/* +Copyright Redshift Software Inc 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_ARCHITECTURE_PYRAMID_H +#define BOOST_PREDEF_ARCHITECTURE_PYRAMID_H + +#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_PYRAMID`] + +Pyramid 9810 architecture. + */ + +#define BOOST_ARCHITECTURE_PYRAMID BOOST_VERSION_NUMBER(0,0,0) + +#if defined(pyr) + #undef BOOST_ARCHITECTURE_PYRAMID + #define BOOST_ARCHITECTURE_PYRAMID BOOST_VERSION_NUMBER(0,0,1) +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_PYRAMID,"Pyramid 9810") + +#endif diff --git a/boost/predef/architecture/rs6k.h b/boost/predef/architecture/rs6k.h index ab487ad..10201f6 100644 --- a/boost/predef/architecture/rs6k.h +++ b/boost/predef/architecture/rs6k.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_RS6K_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_RS6000`] + +[@http://en.wikipedia.org/wiki/RS/6000 RS/6000] architecture. + */ #define BOOST_ARCHITECTURE_RS6000 BOOST_VERSION_NUMBER(0,0,0) @@ -22,4 +28,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCHITECTURE_PWR BOOST_ARCHITECTURE_RS6000 +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_RS6000,"RS/6000") + #endif diff --git a/boost/predef/architecture/sparc.h b/boost/predef/architecture/sparc.h index 645fb54..d344de1 100644 --- a/boost/predef/architecture/sparc.h +++ b/boost/predef/architecture/sparc.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,19 +9,28 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_SPARC_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_SPARC`] + +[@http://en.wikipedia.org/wiki/SPARC SPARC] architecture. + */ #define BOOST_ARCHITECTURE_SPARC BOOST_VERSION_NUMBER(0,0,0) #if defined(__sparc__) || defined(__sparc) #undef BOOST_ARCHITECTURE_SPARC - #if defined(__sparcv8) - #define BOOST_ARCHITECTURE_SPARC BOOST_VERSION_NUMBER(8,0,0) - #elif defined(__sparcv9) + #if defined(__sparcv9) #define BOOST_ARCHITECTURE_SPARC BOOST_VERSION_NUMBER(9,0,0) + #elif defined(__sparcv8) + #define BOOST_ARCHITECTURE_SPARC BOOST_VERSION_NUMBER(8,0,0) #else #define BOOST_ARCHITECTURE_SPARC BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_SPARC,"SPARC") + #endif diff --git a/boost/predef/architecture/superh.h b/boost/predef/architecture/superh.h index dc3e4cc..2710909 100644 --- a/boost/predef/architecture/superh.h +++ b/boost/predef/architecture/superh.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,25 +9,35 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_SUPERH_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_SH`] + +[@http://en.wikipedia.org/wiki/SuperH SuperH] architecture: +If available versions [1-5] are specifically detected. + */ #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(0,0,0) #if defined(__sh__) #undef BOOST_ARCHITECTURE_SH - #if defined(__sh1__) - #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(1,0,0) - #elif defined(__sh2__) - #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(2,0,0) - #elif defined(__sh3__) || defined(__SH3__) - #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(3,0,0) + #if defined(__SH5__) + #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(5,0,0) #elif defined(__SH4__) #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(4,0,0) - #elif defined(__SH5__) - #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(5,0,0) + #elif defined(__sh3__) || defined(__SH3__) + #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(3,0,0) + #elif defined(__sh2__) + #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(2,0,0) + #elif defined(__sh1__) + #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(1,0,0) #else #define BOOST_ARCHITECTURE_SH BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_SH,"SuperH") + #endif diff --git a/boost/predef/architecture/sys370.h b/boost/predef/architecture/sys370.h index 4ef1913..eb0d6df 100644 --- a/boost/predef/architecture/sys370.h +++ b/boost/predef/architecture/sys370.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_SYS370_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_SYS370`] + +[@http://en.wikipedia.org/wiki/System/370 System/370] architecture. + */ #define BOOST_ARCHITECTURE_SYS370 BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +24,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCHITECTURE_SYS370 BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_SYS370,"System/370") + #endif diff --git a/boost/predef/architecture/sys390.h b/boost/predef/architecture/sys390.h index 41ef73f..e7c2107 100644 --- a/boost/predef/architecture/sys390.h +++ b/boost/predef/architecture/sys390.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_SYS390_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_SYS390`] + +[@http://en.wikipedia.org/wiki/System/390 System/390] architecture. + */ #define BOOST_ARCHITECTURE_SYS390 BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +24,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCHITECTURE_SYS390 BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_SYS390,"System/390") + #endif diff --git a/boost/predef/architecture/x86.h b/boost/predef/architecture/x86.h index 5f4d9f2..785f20c 100644 --- a/boost/predef/architecture/x86.h +++ b/boost/predef/architecture/x86.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,24 +9,42 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_X86_H #include -#include +#include #define BOOST_ARCHITECTURE_X86 BOOST_VERSION_NUMBER(0,0,0) +/*` +[heading `BOOST_ARCHITECTURE_X86`] + +[@http://en.wikipedia.org/wiki/X86 Intel x86] architecture: +If available versions [3-6] are specifically detected. + */ + #if defined(i386) || defined(__i386__) || \ - defeind(__i486__) || defined(__i586__) || \ - defeind(__i686__) || defined(__i386) || \ - defeind(_M_IX86) || defined(_X86_) || \ - defeind(__THW_INTEL__) || defined(__I86__) || \ - defeind(__INTEL__) + defined(__i486__) || defined(__i586__) || \ + defined(__i686__) || defined(__i386) || \ + defined(_M_IX86) || defined(_X86_) || \ + defined(__THW_INTEL__) || defined(__I86__) || \ + defined(__INTEL__) #undef BOOST_ARCHITECTURE_X86 #if defined(__I86__) #define BOOST_ARCHITECTURE_X86 BOOST_VERSION_NUMBER(__I86__,0,0) #elif defined(_M_IX86) - #define BOOST_ARCHITECTURE_X86 BOOST_PREDEF_VRP_N_N_N(_M_IX86) + #define BOOST_ARCHITECTURE_X86 BOOST_PREDEF_MAKE_NN_00(_M_IX86) + #elif defined(__i686__) + #define BOOST_ARCHITECTURE_X86 BOOST_VERSION_NUMBER(6,0,0) + #elif defined(__i586__) + #define BOOST_ARCHITECTURE_X86 BOOST_VERSION_NUMBER(5,0,0) + #elif defined(__i486__) + #define BOOST_ARCHITECTURE_X86 BOOST_VERSION_NUMBER(4,0,0) + #elif defined(__i386__) + #define BOOST_ARCHITECTURE_X86 BOOST_VERSION_NUMBER(3,0,0) #else #define BOOST_ARCHITECTURE_X86 BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_X86,"Intel x86") + #endif diff --git a/boost/predef/architecture/z.h b/boost/predef/architecture/z.h index 5632681..0f13d8a 100644 --- a/boost/predef/architecture/z.h +++ b/boost/predef/architecture/z.h @@ -1,5 +1,5 @@ /* -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,12 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_ARCHITECTURE_Z_H #include -#include +#include + +/*` +[heading `BOOST_ARCHITECTURE_Z`] + +[@http://en.wikipedia.org/wiki/Z/Architecture z/Architecture] architecture. */ #define BOOST_ARCHITECTURE_Z BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +23,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCHITECTURE_Z BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCHITECTURE_Z,"z/Architecture") + #endif diff --git a/boost/predef/compiler.h b/boost/predef/compiler.h index a3c69ca..58b4b50 100644 --- a/boost/predef/compiler.h +++ b/boost/predef/compiler.h @@ -17,8 +17,8 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include -#include #include +#include #include #include #include diff --git a/boost/predef/compiler/borland.h b/boost/predef/compiler/borland.h index c5e5571..ff2b044 100644 --- a/boost/predef/compiler/borland.h +++ b/boost/predef/compiler/borland.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_BORLAND_H #include -#include +#include #define BOOST_CXX_BORLAND BOOST_VERSION_NUMBER(0,0,0) #if defined(__BORLANDC__) #undef BOOST_CXX_BORLAND - #define BOOST_CXX_BORLAND BOOST_PREDEF_VRP_FF_F_F(__BORLANDC__) + #define BOOST_CXX_BORLAND BOOST_PREDEF_MAKE_FF_F_F(__BORLANDC__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_BORLAND,"Borland") + #endif diff --git a/boost/predef/compiler/comeau.h b/boost/predef/compiler/comeau.h index f0e3ebb..97fd9be 100644 --- a/boost/predef/compiler/comeau.h +++ b/boost/predef/compiler/comeau.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_COMEAU_H #include -#include +#include #define BOOST_CXX_COMO BOOST_VERSION_NUMBER(0,0,0) #if defined(__COMO__) #undef BOOST_CXX_COMO - #define BOOST_CXX_COMO BOOST_PREDEF_VRP_F_F_FF(__COMO_VERSION__) + #define BOOST_CXX_COMO BOOST_PREDEF_MAKE_F_F_FF(__COMO_VERSION__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_COMO,"Comeau") + #endif diff --git a/boost/predef/compiler/compaq.h b/boost/predef/compiler/compaq.h index 5b21224..fc98d1f 100644 --- a/boost/predef/compiler/compaq.h +++ b/boost/predef/compiler/compaq.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_COMPAQ_H #include -#include +#include #define BOOST_CXX_DEC BOOST_VERSION_NUMBER(0,0,0) @@ -21,4 +21,7 @@ http://www.boost.org/LICENSE_1_0.txt) (__DECC_VER%10000)) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_DEC,"Compaq") + #endif diff --git a/boost/predef/compiler/cygwin.h b/boost/predef/compiler/cygwin.h index 476aec5..efc320a 100644 --- a/boost/predef/compiler/cygwin.h +++ b/boost/predef/compiler/cygwin.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_CYGWIN_H #include -#include +#include #define BOOST_CXX_CYGWIN BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_CXX_CYGWIN BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_CYGWIN,"Cygwin") + #endif diff --git a/boost/predef/compiler/diab.h b/boost/predef/compiler/diab.h index 04af008..1460348 100644 --- a/boost/predef/compiler/diab.h +++ b/boost/predef/compiler/diab.h @@ -6,16 +6,19 @@ http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_PREDEF_COMPILER_DIAB_H -#define BOOST_PREDEF_COMPILER_BORLAND_H +#define BOOST_PREDEF_COMPILER_DIAB_H #include -#include +#include #define BOOST_CXX_DIAB BOOST_VERSION_NUMBER(0,0,0) #if defined(__DCC__) #undef BOOST_CXX_DIAB - #define BOOST_CXX_DIAB BOOST_PREDEF_VRP_N_N_NN(__VERSION_NUMBER__) + #define BOOST_CXX_DIAB BOOST_PREDEF_MAKE_N_N_NN(__VERSION_NUMBER__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_DIAB,"Diab") + #endif diff --git a/boost/predef/compiler/digitalmars.h b/boost/predef/compiler/digitalmars.h index 9e50c59..01aa476 100644 --- a/boost/predef/compiler/digitalmars.h +++ b/boost/predef/compiler/digitalmars.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_DIGITALMARS_H #include -#include +#include #define BOOST_CXX_DMC BOOST_VERSION_NUMBER(0,0,0) #if defined(__DMC__) #undef BOOST_CXX_DMC - #define BOOST_CXX_DMC BOOST_PREDEF_VRP_F_F_F(__DMC__) + #define BOOST_CXX_DMC BOOST_PREDEF_MAKE_F_F_F(__DMC__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_DMC,"Digital Mars") + #endif diff --git a/boost/predef/compiler/dignus.h b/boost/predef/compiler/dignus.h index e903c14..fb3e9c2 100644 --- a/boost/predef/compiler/dignus.h +++ b/boost/predef/compiler/dignus.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_DIGNUS_H #include -#include +#include #define BOOST_CXX_SYSC BOOST_VERSION_NUMBER(0,0,0) #if defined(__SYSC__) #undef BOOST_CXX_SYSC - #define BOOST_CXX_SYSC BOOST_PREDEF_VRP_N_NN_NN(__SYSC_VER__) + #define BOOST_CXX_SYSC BOOST_PREDEF_MAKE_N_NN_NN(__SYSC_VER__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_SYSC,"SysC") + #endif diff --git a/boost/predef/compiler/edg.h b/boost/predef/compiler/edg.h index e74cfee..5400193 100644 --- a/boost/predef/compiler/edg.h +++ b/boost/predef/compiler/edg.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_EDG_H #include -#include +#include #define BOOST_CXX_EDG BOOST_VERSION_NUMBER(0,0,0) #if defined(__EDG__) #undef BOOST_CXX_EDG - #define BOOST_CXX_EDG BOOST_PREDEF_VRP_N_N_N(__EDG_VERSION__) + #define BOOST_CXX_EDG BOOST_PREDEF_MAKE_N_N_N(__EDG_VERSION__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_EDG,"EDG") + #endif diff --git a/boost/predef/compiler/ekopath.h b/boost/predef/compiler/ekopath.h index 4b0363d..cb41746 100644 --- a/boost/predef/compiler/ekopath.h +++ b/boost/predef/compiler/ekopath.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_EKOPATH_H #include -#include +#include #define BOOST_CXX_PATH BOOST_VERSION_NUMBER(0,0,0) @@ -19,4 +19,7 @@ http://www.boost.org/LICENSE_1_0.txt) BOOST_VERSION_NUMBER(__PATHCC__,__PATHCC_MINOR__,__PATHCC_PATCHLEVEL__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_PATH,"Ekopath") + #endif diff --git a/boost/predef/compiler/gcc.h b/boost/predef/compiler/gcc.h index 976b8b6..72eae70 100644 --- a/boost/predef/compiler/gcc.h +++ b/boost/predef/compiler/gcc.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_GCC_H #include -#include +#include #define BOOST_CXX_GNUC BOOST_VERSION_NUMBER(0,0,0) @@ -24,4 +24,7 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_GNUC,"GNUC") + #endif diff --git a/boost/predef/compiler/gcc_xml.h b/boost/predef/compiler/gcc_xml.h index e4a57aa..111f55c 100644 --- a/boost/predef/compiler/gcc_xml.h +++ b/boost/predef/compiler/gcc_xml.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_GCC_XML_H #include -#include +#include #define BOOST_CXX_GCCXML BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_CXX_GCCXML BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_GCCXML,"GCC XML") + #endif diff --git a/boost/predef/compiler/greenhills.h b/boost/predef/compiler/greenhills.h index 4666ef0..f95d6e5 100644 --- a/boost/predef/compiler/greenhills.h +++ b/boost/predef/compiler/greenhills.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_GREENHILLS_H #include -#include +#include #define BOOST_CXX_GHS BOOST_VERSION_NUMBER(0,0,0) #if defined(__ghs) #undef BOOST_CXX_GHS - #define BOOST_CXX_GHS BOOST_PREDEF_VRP_N_N_N(__ghs) + #define BOOST_CXX_GHS BOOST_PREDEF_MAKE_N_N_N(__ghs) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_GHS,"Green Hills") + #endif diff --git a/boost/predef/compiler/hp_acc.h b/boost/predef/compiler/hp_acc.h index 0466912..c79ff0a 100644 --- a/boost/predef/compiler/hp_acc.h +++ b/boost/predef/compiler/hp_acc.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_HP_ACC_H #include -#include +#include #define BOOST_CXX_HPACC BOOST_VERSION_NUMBER(0,0,0) #if defined(__HP_aCC) #undef BOOST_CXX_HPACC - #define BOOST_CXX_HPACC BOOST_PREDEF_VRP_NN_NN_NN(__HP_aCC) + #define BOOST_CXX_HPACC BOOST_PREDEF_MAKE_NN_NN_NN(__HP_aCC) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_HPACC,"HP ACC") + #endif diff --git a/boost/predef/compiler/iar.h b/boost/predef/compiler/iar.h index 9f585e8..9efca6d 100644 --- a/boost/predef/compiler/iar.h +++ b/boost/predef/compiler/iar.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_IAR_H #include -#include +#include #define BOOST_CXX_IAR BOOST_VERSION_NUMBER(0,0,0) #if defined(__IAR_SYSTEMS_ICC__) #undef BOOST_CXX_IAR - #define BOOST_CXX_IAR BOOST_PREDEF_VRP_NN_NN(__VER__) + #define BOOST_CXX_IAR BOOST_PREDEF_MAKE_NN_NN(__VER__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_IAR,"IAR") + #endif diff --git a/boost/predef/compiler/ibm.h b/boost/predef/compiler/ibm.h index 196d76d..f6d1bc8 100644 --- a/boost/predef/compiler/ibm.h +++ b/boost/predef/compiler/ibm.h @@ -9,19 +9,22 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_IBM_H #include -#include +#include #define BOOST_CXX_IBM BOOST_VERSION_NUMBER(0,0,0) #if defined(__IBMCPP__) || defined(__xlC__) #undef BOOST_CXX_IBM #if defined(__COMPILER_VER__) - #define BOOST_CXX_IBM BOOST_PREDEF_VRP_F_FF_FFFF(__COMPILER_VER__) + #define BOOST_CXX_IBM BOOST_PREDEF_MAKE_F_FF_FFFF(__COMPILER_VER__) #elif defined(__xlC__) - #define BOOST_CXX_IBM BOOST_PREDEF_VRP_FF_FF(__xlC__) + #define BOOST_CXX_IBM BOOST_PREDEF_MAKE_FF_FF(__xlC__) #else - #define BOOST_CXX_IBM BOOST_PREDEF_VRP_N_N_N(__IBMCPP__) + #define BOOST_CXX_IBM BOOST_PREDEF_MAKE_N_N_N(__IBMCPP__) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_IBM,"IBM") + #endif diff --git a/boost/predef/compiler/intel.h b/boost/predef/compiler/intel.h index 17dcf39..42ed517 100644 --- a/boost/predef/compiler/intel.h +++ b/boost/predef/compiler/intel.h @@ -9,14 +9,17 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_INTEL_H #include -#include +#include #define BOOST_CXX_INTEL BOOST_VERSION_NUMBER(0,0,0) #if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || \ defined(__ECC) #undef BOOST_CXX_INTEL - #define BOOST_CXX_INTEL BOOST_PREDEF_VRP_N_N_N(__INTEL_COMPILER) + #define BOOST_CXX_INTEL BOOST_PREDEF_MAKE_N_N_N(__INTEL_COMPILER) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_INTEL,"Intel") + #endif diff --git a/boost/predef/compiler/kai.h b/boost/predef/compiler/kai.h index 0c46dfc..55b079b 100644 --- a/boost/predef/compiler/kai.h +++ b/boost/predef/compiler/kai.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_KAI_H #include -#include +#include #define BOOST_CXX_KCC BOOST_VERSION_NUMBER(0,0,0) #if defined(__KCC) #undef BOOST_CXX_KCC - #define BOOST_CXX_KCC BOOST_PREDEF_VRP_F_F_FF(__KCC_VERSION) + #define BOOST_CXX_KCC BOOST_PREDEF_MAKE_F_F_FF(__KCC_VERSION) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_KCC,"Kai") + #endif diff --git a/boost/predef/compiler/llvm.h b/boost/predef/compiler/llvm.h index 9cdc924..89b14b8 100644 --- a/boost/predef/compiler/llvm.h +++ b/boost/predef/compiler/llvm.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_LLVM_H #include -#include +#include #define BOOST_CXX_LLVM BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_CXX_LLVM BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_LLVM,"LLVM") + #endif diff --git a/boost/predef/compiler/metaware.h b/boost/predef/compiler/metaware.h index f64ca80..6ea0eae 100644 --- a/boost/predef/compiler/metaware.h +++ b/boost/predef/compiler/metaware.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_METAWARE_H #include -#include +#include #define BOOST_CXX_HIGHC BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_CXX_HIGHC BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_HIGHC,"Metaware HighC") + #endif diff --git a/boost/predef/compiler/metrowerks.h b/boost/predef/compiler/metrowerks.h index 2a14422..922ca6f 100644 --- a/boost/predef/compiler/metrowerks.h +++ b/boost/predef/compiler/metrowerks.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_METROWERKS_H #include -#include +#include #define BOOST_CXX_MWERKS BOOST_VERSION_NUMBER(0,0,0) @@ -36,8 +36,11 @@ http://www.boost.org/LICENSE_1_0.txt) #elif __MWERKS__ == 0x3206 #define BOOST_CXX_MWERKS BOOST_VERSION_NUMBER(9,5,0) #else - #define BOOST_CXX_MWERKS BOOST_PREDEF_VRP_F_F_FF(__MWERKS__) + #define BOOST_CXX_MWERKS BOOST_PREDEF_MAKE_F_F_FF(__MWERKS__) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_MWERKS,"Metrowerks") + #endif diff --git a/boost/predef/compiler/microtec.h b/boost/predef/compiler/microtec.h index 03d4bc2..8cebec4 100644 --- a/boost/predef/compiler/microtec.h +++ b/boost/predef/compiler/microtec.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_MICROTEC_H #include -#include +#include #define BOOST_CXX_MRI BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_CXX_MRI BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_MRI,"Microtec") + #endif diff --git a/boost/predef/compiler/mingw.h b/boost/predef/compiler/mingw.h index d6a1cd2..bb1e561 100644 --- a/boost/predef/compiler/mingw.h +++ b/boost/predef/compiler/mingw.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_MINGW_H #include -#include +#include #define BOOST_CXX_MINGW BOOST_VERSION_NUMBER(0,0,0) @@ -20,4 +20,7 @@ http://www.boost.org/LICENSE_1_0.txt) BOOST_VERSION_NUMBER(__MINGW32_MAJOR_VERSION,__MINGW32_MINOR_VERSION,0) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_MINGW,"MinGW") + #endif diff --git a/boost/predef/compiler/mpw.h b/boost/predef/compiler/mpw.h index 038e4d3..e788c3a 100644 --- a/boost/predef/compiler/mpw.h +++ b/boost/predef/compiler/mpw.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_MPW_H #include -#include +#include #define BOOST_CXX_MPW BOOST_VERSION_NUMBER(0,0,0) #if defined(__MRC__) #undef BOOST_CXX_MPW - #define BOOST_CXX_MPW BOOST_PREDEF_VRP_FF_FF(__MRC__) + #define BOOST_CXX_MPW BOOST_PREDEF_MAKE_FF_FF(__MRC__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_MPW,"MPW") + #endif diff --git a/boost/predef/compiler/palm.h b/boost/predef/compiler/palm.h index 119f1b7..f057a46 100644 --- a/boost/predef/compiler/palm.h +++ b/boost/predef/compiler/palm.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_PALM_H #include -#include +#include #define BOOST_CXX_PALM BOOST_VERSION_NUMBER(0,0,0) #if defined(_PACC_VER) #undef BOOST_CXX_PALM - #define BOOST_CXX_PALM BOOST_PREDEF_VRP_F_FF_FF_000(_PACC_VER) + #define BOOST_CXX_PALM BOOST_PREDEF_MAKE_F_FF_FF_000(_PACC_VER) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_PALM,"Palm") + #endif diff --git a/boost/predef/compiler/pgi.h b/boost/predef/compiler/pgi.h index 70e4d6c..1ff991b 100644 --- a/boost/predef/compiler/pgi.h +++ b/boost/predef/compiler/pgi.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_PGI_H #include -#include +#include #define BOOST_CXX_PGI BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_CXX_PGI BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_PGI,"PGI") + #endif diff --git a/boost/predef/compiler/sgi_mipspro.h b/boost/predef/compiler/sgi_mipspro.h index 35a1036..b400809 100644 --- a/boost/predef/compiler/sgi_mipspro.h +++ b/boost/predef/compiler/sgi_mipspro.h @@ -9,17 +9,20 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_SGI_MIPSPRO_H #include -#include +#include #define BOOST_CXX_SGI BOOST_VERSION_NUMBER(0,0,0) #if defined(__sgi) #undef BOOST_CXX_SGI #if defined(_SGI_COMPILER_VERSION) - #define BOOST_CXX_SGI BOOST_PREDEF_VRP_N_N_N(_SGI_COMPILER_VERSION) + #define BOOST_CXX_SGI BOOST_PREDEF_MAKE_N_N_N(_SGI_COMPILER_VERSION) #else - #define BOOST_CXX_SGI BOOST_PREDEF_VRP_N_N_N(_COMPILER_VERSION) + #define BOOST_CXX_SGI BOOST_PREDEF_MAKE_N_N_N(_COMPILER_VERSION) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_SGI,"SGI Mips-pro") + #endif diff --git a/boost/predef/compiler/sunpro.h b/boost/predef/compiler/sunpro.h index 29d4bc9..e476a93 100644 --- a/boost/predef/compiler/sunpro.h +++ b/boost/predef/compiler/sunpro.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_SUNPRO_H #include -#include +#include #define BOOST_CXX_SUNPRO BOOST_VERSION_NUMBER(0,0,0) #if defined(__SUNPRO_CC) #undef BOOST_CXX_SUNPRO - #define BOOST_CXX_SUNPRO BOOST_PREDEF_VRP_F_F_F(__SUNPRO_CC) + #define BOOST_CXX_SUNPRO BOOST_PREDEF_MAKE_F_F_F(__SUNPRO_CC) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_SUNPRO,"Sun Pro") + #endif diff --git a/boost/predef/compiler/tendra.h b/boost/predef/compiler/tendra.h index acf9b5e..acb4946 100644 --- a/boost/predef/compiler/tendra.h +++ b/boost/predef/compiler/tendra.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_TENDRA_H #include -#include +#include #define BOOST_CXX_TENDRA BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_CXX_TENDRA BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_TENDRA,"Tendra") + #endif diff --git a/boost/predef/compiler/visualc.h b/boost/predef/compiler/visualc.h index 5334ca6..210c369 100644 --- a/boost/predef/compiler/visualc.h +++ b/boost/predef/compiler/visualc.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_VISUALC_H #include -#include +#include #define BOOST_CXX_MSVC BOOST_VERSION_NUMBER(0,0,0) @@ -35,4 +35,7 @@ http://www.boost.org/LICENSE_1_0.txt) BOOST_CXX_MSVC_BUILD) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_MSVC,"Microsoft Visual C/C++") + #endif diff --git a/boost/predef/compiler/watcom.h b/boost/predef/compiler/watcom.h index a2fed64..f5f7cd9 100644 --- a/boost/predef/compiler/watcom.h +++ b/boost/predef/compiler/watcom.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_COMPILER_WATCOM_H #include -#include +#include #define BOOST_CXX_WATCOM BOOST_VERSION_NUMBER(0,0,0) #if defined(__WATCOMC__) #undef BOOST_CXX_WATCOM - #define BOOST_CXX_WATCOM BOOST_PREDEF_VRP_NN_NN(__WATCOMC__) + #define BOOST_CXX_WATCOM BOOST_PREDEF_MAKE_NN_NN(__WATCOMC__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_CXX_WATCOM,"Watcom") + #endif diff --git a/boost/predef/detail/_cassert.h b/boost/predef/detail/_cassert.h new file mode 100644 index 0000000..41f5ec4 --- /dev/null +++ b/boost/predef/detail/_cassert.h @@ -0,0 +1,17 @@ +/* +Copyright Redshift Software, Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_DETAIL__CASSERT_H +#define BOOST_PREDEF_DETAIL__CASSERT_H + +#if defined(__cpluplus) +#include +#else +#include +#endif + +#endif diff --git a/boost/predef/detail/_exception.h b/boost/predef/detail/_exception.h new file mode 100644 index 0000000..f0d7f48 --- /dev/null +++ b/boost/predef/detail/_exception.h @@ -0,0 +1,15 @@ +/* +Copyright Redshift Software, Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_DETAIL__EXCEPTION_H +#define BOOST_PREDEF_DETAIL__EXCEPTION_H + +#if defined(__cpluplus) +#include +#endif + +#endif diff --git a/boost/predef/detail/test.h b/boost/predef/detail/test.h new file mode 100644 index 0000000..6b17215 --- /dev/null +++ b/boost/predef/detail/test.h @@ -0,0 +1,17 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_DETAIL_TEST_H +#define BOOST_PREDEF_DETAIL_TEST_H + +#if !defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) + +#define BOOST_PREDEF_DECLARE_TEST(x,s) + +#endif + +#endif diff --git a/boost/predef/detail/vrp.h b/boost/predef/detail/vrp.h deleted file mode 100644 index c7f6f43..0000000 --- a/boost/predef/detail/vrp.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright Redshift Software, Inc. 2008-2010 -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_PREDEF_DETAIL_VRP_H -#define BOOST_PREDEF_DETAIL_VRP_H - -/* Shorthands for the common version number formats used by vendors... */ - -/* Hexadecimal... */ -#define BOOST_PREDEF_VRP_F_F_F(V) BOOST_VERSION_NUMBER((V&0xF00)>>8,(V&0xF0)>>4,(V&0xF)) -#define BOOST_PREDEF_VRP_FF_F_F(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xF0)>>4,(V&0xF)) -#define BOOST_PREDEF_VRP_F_F_FF(V) BOOST_VERSION_NUMBER((V&0xF000)>>12,(V&0xF00)>>8,(V&0xFF)) -#define BOOST_PREDEF_VRP_FF_FF(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xFF),0) -#define BOOST_PREDEF_VRP_F_FF_FFFF(V) BOOST_VERSION_NUMBER((V&0xF000000)>>24,(V&0xFF0000)>>16,(V&0xFFFF)) -#define BOOST_PREDEF_VRP_FF_FF_F(V) BOOST_VERSION_NUMBER((V&0xFF000)>>12,(V&0xFF0)>>4,(V&0xF)) -#define BOOST_PREDEF_VRP_F_FF_FF_000(V) BOOST_VERSION_NUMBER((V&0xF0000000)>>28,(V&0xFF00000)>>20,(V&0xFF000)>>12) - -/* Decimal... */ -#define BOOST_PREDEF_VRP_N_N_N(V) BOOST_VERSION_NUMBER((V)/100,(V%100)/10,(V%10)) -#define BOOST_PREDEF_VRP_NN_NN_NN(V) BOOST_VERSION_NUMBER((V)/10000,(V%10000)/100,(V%100)) -#define BOOST_PREDEF_VRP_NN_NN(V) BOOST_VERSION_NUMBER((V%10000)/100,(V%100),0) -#define BOOST_PREDEF_VRP_N_N_NN(V) BOOST_VERSION_NUMBER((V)/1000,(V%1000)/100,(V%100)) -#define BOOST_PREDEF_VRP_N_NN_NN(V) BOOST_VERSION_NUMBER((V)/10000,(V%10000)/100,(V%100)) -#define BOOST_PREDEF_VRP_N_N_N_000(V) BOOST_VERSION_NUMBER((V%100000)/100000,(V%10000)/10000,(V%1000)/1000) -#define BOOST_PREDEF_VRP_N_NN_000(V) BOOST_VERSION_NUMBER((V%100000)/100000,(V%10000)/1000,0) -#define BOOST_PREDEF_VRP_NN_NN_00_NN_00(V) BOOST_VERSION_NUMBER((V)/100000000,(V%100000000)/1000000,(V%10000)/100) - -#endif diff --git a/boost/predef/language.h b/boost/predef/language.h new file mode 100644 index 0000000..c088fe7 --- /dev/null +++ b/boost/predef/language.h @@ -0,0 +1,15 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_LANGUAGE_H +#define BOOST_PREDEF_LANGUAGE_H + +#include +#include +#include + +#endif diff --git a/boost/predef/language/objc.h b/boost/predef/language/objc.h new file mode 100644 index 0000000..5879fce --- /dev/null +++ b/boost/predef/language/objc.h @@ -0,0 +1,30 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_LANGUAGE_OBJC_H +#define BOOST_PREDEF_LANGUAGE_OBJC_H + +#include +#include + +/*` +[heading `BOOST_LANGUAGE_OBJC`] + +Objective C language. + */ + +#define BOOST_LANGUAGE_OBJC BOOST_VERSION_NUMBER(0,0,0) + +#if defined(__OBJC__) + #undef BOOST_LANGUAGE_OBJC + #define BOOST_LANGUAGE_OBJC BOOST_VERSION_NUMBER(0,0,1) +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LANGUAGE_OBJC,"Objective C") + +#endif diff --git a/boost/predef/language/stdc.h b/boost/predef/language/stdc.h new file mode 100644 index 0000000..6370886 --- /dev/null +++ b/boost/predef/language/stdc.h @@ -0,0 +1,39 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_LANGUAGE_STDC_H +#define BOOST_PREDEF_LANGUAGE_STDC_H + +#include +#include + +/*` +[heading `BOOST_LANGUAGE_STDC`] + +Standard C language. If available, the year of the standard +is detected as 0.0.YYYY. + */ + +#define BOOST_LANGUAGE_STDC BOOST_VERSION_NUMBER(0,0,0) + +#if defined(__STDC__) + #undef BOOST_LANGUAGE_STDC + #if defined(__STDC_VERSION__) + #if (__STDC_VERSION__ > 100) + #define BOOST_LANGUAGE_STDC BOOST_VERSION_NUMBER(0,0,__STDC_VERSION__/100) + #else + #define BOOST_LANGUAGE_STDC BOOST_VERSION_NUMBER(0,0,1) + #endif + #else + #define BOOST_LANGUAGE_STDC BOOST_VERSION_NUMBER(0,0,1) + #endif +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LANGUAGE_STDC,"Standard C") + +#endif diff --git a/boost/predef/language/stdcpp.h b/boost/predef/language/stdcpp.h new file mode 100644 index 0000000..e7ef26f --- /dev/null +++ b/boost/predef/language/stdcpp.h @@ -0,0 +1,72 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_LANGUAGE_STDCPP_H +#define BOOST_PREDEF_LANGUAGE_STDCPP_H + +#include +#include + +/*` +[heading `BOOST_LANGUAGE_STDCPP`] + +Standard C++ language. If available, the year of the standard +is detected as 0.0.YYYY. + */ + +#define BOOST_LANGUAGE_STDCPP BOOST_VERSION_NUMBER(0,0,0) + +#if defined(__cplusplus) + #undef BOOST_LANGUAGE_STDCPP + #if (__cplusplus > 100) + #define BOOST_LANGUAGE_STDCPP BOOST_VERSION_NUMBER(0,0,__cplusplus/100) + #else + #define BOOST_LANGUAGE_STDCPP BOOST_VERSION_NUMBER(0,0,1) + #endif +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LANGUAGE_STDCPP,"Standard C++") + +/*` +[heading `BOOST_LANGUAGE_STDCPPCLI`] + +Standard C++/CLI language. If available, the year of the standard +is detected as 0.0.YYYY. + */ + +#define BOOST_LANGUAGE_STDCPPCLI BOOST_VERSION_NUMBER(0,0,0) + +#if defined(__cplusplus_cli) + #undef BOOST_LANGUAGE_STDCPPCLI + #if (__cplusplus_cli > 100) + #define BOOST_LANGUAGE_STDCPPCLI BOOST_VERSION_NUMBER(0,0,__cplusplus_cli/100) + #else + #define BOOST_LANGUAGE_STDCPPCLI BOOST_VERSION_NUMBER(0,0,1) + #endif +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LANGUAGE_STDCPPCLI,"Standard C++/CLI") + +/*` +[heading `BOOST_LANGUAGE_STDECPP`] + +Standard Embedded C++ language. + */ + +#define BOOST_LANGUAGE_STDECPP BOOST_VERSION_NUMBER(0,0,0) + +#if defined(__embedded_cplusplus) + #undef BOOST_LANGUAGE_STDECPP + #define BOOST_LANGUAGE_STDECPP BOOST_VERSION_NUMBER(0,0,1) +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LANGUAGE_STDECPP,"Standard Embedded C++") + +#endif diff --git a/boost/predef/library/c.h b/boost/predef/library/c.h index 64a25ac..fac9784 100644 --- a/boost/predef/library/c.h +++ b/boost/predef/library/c.h @@ -8,7 +8,7 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_LIBRARY_C_H #define BOOST_PREDEF_LIBRARY_C_H -#include +#include #include #include diff --git a/boost/predef/library/c/gnu.h b/boost/predef/library/c/gnu.h index 271a01a..cf32012 100644 --- a/boost/predef/library/c/gnu.h +++ b/boost/predef/library/c/gnu.h @@ -9,7 +9,13 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_C_GNU_H #include -#include +#include + +#if defined(__STDC__) +#include +#elif defined(__cplusplus) +#include +#endif #define BOOST_LIBC_GNU BOOST_VERSION_NUMBER(0,0,0) @@ -21,6 +27,10 @@ http://www.boost.org/LICENSE_1_0.txt) #else #define BOOST_LIBC_GNU \ BOOST_VERSION_NUMBER(__GNU_LIBRARY__,__GNU_LIBRARY_MINOR__,0) + #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBC_GNU,"GNU") + #endif diff --git a/boost/predef/library/c/uc.h b/boost/predef/library/c/uc.h index 12682aa..05e268f 100644 --- a/boost/predef/library/c/uc.h +++ b/boost/predef/library/c/uc.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_C_UC_H #include -#include +#include #define BOOST_LIBC_UC BOOST_VERSION_NUMBER(0,0,0) @@ -19,4 +19,7 @@ http://www.boost.org/LICENSE_1_0.txt) __UCLIBC_MAJOR__,__UCLIBC_MINOR__,__UCLIBC_SUBLEVEL__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBC_UC,"uC") + #endif diff --git a/boost/predef/library/c/vms.h b/boost/predef/library/c/vms.h index c272425..5c3fc56 100644 --- a/boost/predef/library/c/vms.h +++ b/boost/predef/library/c/vms.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_C_VMS_H #include -#include +#include #define BOOST_LIBC_VMS BOOST_VERSION_NUMBER(0,0,0) @@ -21,4 +21,7 @@ http://www.boost.org/LICENSE_1_0.txt) (__CRTL_VER%10000)/100) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBC_VMS,"VMS") + #endif diff --git a/boost/predef/library/c/zos.h b/boost/predef/library/c/zos.h index 947f29f..e1f9351 100644 --- a/boost/predef/library/c/zos.h +++ b/boost/predef/library/c/zos.h @@ -9,13 +9,16 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_C_ZOS_H #include -#include +#include #define BOOST_LIBC_ZOS BOOST_VERSION_NUMBER(0,0,0) #if defined(__LIBREL__) #undef BOOST_LIBC_ZOS - #define BOOST_LIBC_ZOS BOOST_PREDEF_VRP_F_FF_FFFF(__LIBREL__) + #define BOOST_LIBC_ZOS BOOST_PREDEF_MAKE_F_FF_FFFF(__LIBREL__) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBC_ZOS,"zOS") + #endif diff --git a/boost/predef/library/std.h b/boost/predef/library/std.h index 522b216..d5f0187 100644 --- a/boost/predef/library/std.h +++ b/boost/predef/library/std.h @@ -16,11 +16,11 @@ seems to be . Boost uses but as far as I can tell (RR) it's not a standalone header in most implementations. Using also has the benefit of being available in EC++, so we get a chance to make this work -for embeded users. And since it's not a header impacted by TR1 +for embedded users. And since it's not a header impacted by TR1 there's no magic needed for inclusion in the face of the Boost.TR1 library. */ -#include +#include /* STLPort library; this _must_ come first, otherwise since @@ -30,7 +30,7 @@ can end up detecting that first rather than STLport: #include /* -The rest in apha order, except for Dinkumware. +The rest in alpha order, except for Dinkumware. */ #include #include diff --git a/boost/predef/library/std/dinkumware.h b/boost/predef/library/std/dinkumware.h index bc36562..c7b9081 100644 --- a/boost/predef/library/std/dinkumware.h +++ b/boost/predef/library/std/dinkumware.h @@ -9,17 +9,20 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_DINKUMWARE_H #include -#include +#include #define BOOST_LIBSTD_DINKUMWARE BOOST_VERSION_NUMBER(0,0,0) #if (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) #undef BOOST_LIBSTD_DINKUMWARE #if defined(_CPPLIB_VER) - #define BOOST_LIBSTD_DINKUMWARE BOOST_PREDEF_VRP_NN_NN(__CPPLIB_VER) + #define BOOST_LIBSTD_DINKUMWARE BOOST_PREDEF_MAKE_NN_NN(__CPPLIB_VER) #else #define BOOST_LIBSTD_DINKUMWARE BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_DINKUMWARE,"Dinkumware") + #endif diff --git a/boost/predef/library/std/libcomo.h b/boost/predef/library/std/libcomo.h index a46e4a8..7de99f3 100644 --- a/boost/predef/library/std/libcomo.h +++ b/boost/predef/library/std/libcomo.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_LIBCOMO_H #include -#include +#include #define BOOST_LIBSTD_COMO BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LIBSTD_COMO BOOST_VERSION_NUMBER(__LIBCOMO_VERSION__,0,0) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_COMO,"Como") + #endif diff --git a/boost/predef/library/std/modena.h b/boost/predef/library/std/modena.h index 24cbbc3..2439cff 100644 --- a/boost/predef/library/std/modena.h +++ b/boost/predef/library/std/modena.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_MODENA_H #include -#include +#include #define BOOST_LIBSTD_MSIPL BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LIBSTD_MSIPL BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_MSIPL,"Modena MSIPL") + #endif diff --git a/boost/predef/library/std/msl.h b/boost/predef/library/std/msl.h index ae7664e..d78b0b5 100644 --- a/boost/predef/library/std/msl.h +++ b/boost/predef/library/std/msl.h @@ -9,17 +9,20 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_MSL_H #include -#include +#include #define BOOST_LIBSTD_MSL BOOST_VERSION_NUMBER(0,0,0) #if defined(__MSL_CPP__) || defined(__MSL__) #undef BOOST_LIBSTD_MSL #if defined(__MSL_CPP__) - #define BOOST_LIBSTD_MSL BOOST_PREDEF_VRP_F_F_FF(__MSL_CPP__) + #define BOOST_LIBSTD_MSL BOOST_PREDEF_MAKE_F_F_FF(__MSL_CPP__) #else - #define BOOST_LIBSTD_MSL BOOST_PREDEF_VRP_F_F_FF(__MSL__) + #define BOOST_LIBSTD_MSL BOOST_PREDEF_MAKE_F_F_FF(__MSL__) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_MSL,"Metrowerks") + #endif diff --git a/boost/predef/library/std/roguewave.h b/boost/predef/library/std/roguewave.h index 54d39e0..22be74a 100644 --- a/boost/predef/library/std/roguewave.h +++ b/boost/predef/library/std/roguewave.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_ROGUEWAVE_H #include -#include +#include #define BOOST_LIBSTD_RW BOOST_VERSION_NUMBER(0,0,0) @@ -17,13 +17,16 @@ http://www.boost.org/LICENSE_1_0.txt) #undef BOOST_LIBSTD_RW #if defined(_RWSTD_VER) #if _RWSTD_VER < 0x010000 - #define BOOST_LIBSTD_RW BOOST_PREDEF_VRP_FF_FF_F(_RWSTD_VER) + #define BOOST_LIBSTD_RW BOOST_PREDEF_MAKE_FF_FF_F(_RWSTD_VER) #else - #define BOOST_LIBSTD_RW BOOST_PREDEF_VRP_FF_FF_FF(_RWSTD_VER) + #define BOOST_LIBSTD_RW BOOST_PREDEF_MAKE_FF_FF_FF(_RWSTD_VER) #endif #else #define BOOST_LIBSTD_RW BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_RW,"Roguewave") + #endif diff --git a/boost/predef/library/std/sgi.h b/boost/predef/library/std/sgi.h index 1bb9559..b5b58a0 100644 --- a/boost/predef/library/std/sgi.h +++ b/boost/predef/library/std/sgi.h @@ -9,17 +9,20 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_SGI_H #include -#include +#include #define BOOST_LIBSTD_SGI BOOST_VERSION_NUMBER(0,0,0) #if defined(__STL_CONFIG_H) #undef BOOST_LIBSTD_SGI #if defined(__SGI_STL) - #define BOOST_LIBSTD_SGI BOOST_PREDEF_VRP_F_F_F(__SGI_STL) + #define BOOST_LIBSTD_SGI BOOST_PREDEF_MAKE_F_F_F(__SGI_STL) #else #define BOOST_LIBSTD_SGI BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_SGI,"SGI") + #endif diff --git a/boost/predef/library/std/stdcpp3.h b/boost/predef/library/std/stdcpp3.h index 7505fc9..00ada66 100644 --- a/boost/predef/library/std/stdcpp3.h +++ b/boost/predef/library/std/stdcpp3.h @@ -9,17 +9,22 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_STDCPP3_H #include -#include +#include #define BOOST_LIBSTD_GNU BOOST_VERSION_NUMBER(0,0,0) #if defined(__GLIBCPP__) || defined(__GLIBCXX__) #undef BOOST_LIBSTD_GNU #if defined(__GLIBCXX__) - #define BOOST_LIBSTD_GNU BOOST_PREDEF_VRP_NN_NN_NN(__GLIBCXX__) + #define BOOST_LIBSTD_GNU BOOST_PREDEF_MAKE_YYYY_MM_DD(__GLIBCXX__) + #elif + #define BOOST_LIBSTD_GNU BOOST_PREDEF_MAKE_YYYY_MM_DD(__GLIBCPP__) #else - #define BOOST_LIBSTD_GNU BOOST_PREDEF_VRP_NN_NN_NN(__GLIBCPP__) + #define BOOST_LIBSTD_GNU BOOST_VERSION_NUMBER(0,0,1) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_GNU,"GNU") + #endif diff --git a/boost/predef/library/std/stlport.h b/boost/predef/library/std/stlport.h index dfcd04d..89aa0b1 100644 --- a/boost/predef/library/std/stlport.h +++ b/boost/predef/library/std/stlport.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_STLPORT_H #include -#include +#include #define BOOST_LIBSTD_STLPORT BOOST_VERSION_NUMBER(0,0,0) @@ -19,10 +19,13 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LIBSTD_STLPORT \ BOOST_VERSION_NUMBER(_STLPORT_MAJOR,_STLPORT_MINOR,_STLPORT_PATCHLEVEL) #elif defined(_STLPORT_VERSION) - #define BOOST_LIBSTD_STLPORT BOOST_PREDEF_VRP_F_F_F(_STLPORT_VERSION) + #define BOOST_LIBSTD_STLPORT BOOST_PREDEF_MAKE_F_F_F(_STLPORT_VERSION) #else - #define BOOST_LIBSTD_STLPORT BOOST_PREDEF_VRP_F_F_F(__SGI_STL_PORT) + #define BOOST_LIBSTD_STLPORT BOOST_PREDEF_MAKE_F_F_F(__SGI_STL_PORT) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_STLPORT,"STLport") + #endif diff --git a/boost/predef/library/std/vacpp.h b/boost/predef/library/std/vacpp.h index ba1f872..f5fd75a 100644 --- a/boost/predef/library/std/vacpp.h +++ b/boost/predef/library/std/vacpp.h @@ -9,7 +9,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_LIBRARY_STD_VACPP_H #include -#include +#include #define BOOST_LIBSTD_IBM BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LIBSTD_IBM BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIBSTD_IBM,"IBM VACPP") + #endif diff --git a/boost/predef/make.h b/boost/predef/make.h new file mode 100644 index 0000000..9809f3d --- /dev/null +++ b/boost/predef/make.h @@ -0,0 +1,72 @@ +/* +Copyright Redshift Software, Inc. 2008-2010 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include + +#ifndef BOOST_PREDEF_MAKE_H +#define BOOST_PREDEF_MAKE_H + +/* +Shorthands for the common version number formats used by vendors... +*/ + +/*` +[heading `BOOST_PREDEF_MAKE_F..` macros] + +These set of macros decompose common vendor version number +macros which are composed of hexadecimal digits. The naming +convention indicates what the format of the vendor version +number. Where "`F`" indicates a hexadecimal digit, "`_`" +separates the major/minor/patch parts of the version number, +and "`0`" indicates an ignored hexadecimal digit. Macros are: +*/ +/*` `BOOST_PREDER_MAKE_F_F_F(V)` */ +#define BOOST_PREDEF_MAKE_F_F_F(V) BOOST_VERSION_NUMBER((V&0xF00)>>8,(V&0xF0)>>4,(V&0xF)) +/*` `BOOST_PREDEF_MAKE_FF_F_F(V)` */ +#define BOOST_PREDEF_MAKE_FF_F_F(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xF0)>>4,(V&0xF)) +/*` `BOOST_PREDEF_MAKE_F_F_FF(V)` */ +#define BOOST_PREDEF_MAKE_F_F_FF(V) BOOST_VERSION_NUMBER((V&0xF000)>>12,(V&0xF00)>>8,(V&0xFF)) +/*` `BOOST_PREDEF_MAKE_FF_FF(V)` */ +#define BOOST_PREDEF_MAKE_FF_FF(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xFF),0) +/*` `BOOST_PREDEF_MAKE_F_FF_FFFF(V)` */ +#define BOOST_PREDEF_MAKE_F_FF_FFFF(V) BOOST_VERSION_NUMBER((V&0xF000000)>>24,(V&0xFF0000)>>16,(V&0xFFFF)) +/*` `BOOST_PREDEF_MAKE_FF_FF_F(V)` */ +#define BOOST_PREDEF_MAKE_FF_FF_F(V) BOOST_VERSION_NUMBER((V&0xFF000)>>12,(V&0xFF0)>>4,(V&0xF)) +/*` `BOOST_PREDEF_MAKE_F_FF_FF_000(V)` */ +#define BOOST_PREDEF_MAKE_F_FF_FF_000(V) BOOST_VERSION_NUMBER((V&0xF0000000)>>28,(V&0xFF00000)>>20,(V&0xFF000)>>12) + +/*` +[heading `BOOST_PREDEF_MAKE_N..` macros] + +These set of macros decompose common vendor version number +macros which are composed of decimal digits. The naming +convention indicates what the format of the vendor version +number. Where "`N`" indicates a decimal digit, "`_`" +separates the major/minor/patch parts of the version number, +and "`0`" indicates an ignored decimal digit. Macros are: +*/ +/*` `BOOST_PREDEF_MAKE_N_N_N(V)` */ +#define BOOST_PREDEF_MAKE_N_N_N(V) BOOST_VERSION_NUMBER((V)/100,(V%100)/10,(V%10)) +/*` `BOOST_PREDEF_MAKE_NN_NN_NN(V)` */ +#define BOOST_PREDEF_MAKE_NN_NN_NN(V) BOOST_VERSION_NUMBER((V)/10000,(V%10000)/100,(V%100)) +/*` `BOOST_PREDEF_MAKE_NN_NN(V)` */ +#define BOOST_PREDEF_MAKE_NN_NN(V) BOOST_VERSION_NUMBER((V%10000)/100,(V%100),0) +/*` `BOOST_PREDEF_MAKE_N_N_NN(V)` */ +#define BOOST_PREDEF_MAKE_N_N_NN(V) BOOST_VERSION_NUMBER((V)/1000,(V%1000)/100,(V%100)) +/*` `BOOST_PREDEF_MAKE_N_NN_NN(V)` */ +#define BOOST_PREDEF_MAKE_N_NN_NN(V) BOOST_VERSION_NUMBER((V)/10000,(V%10000)/100,(V%100)) +/*` `BOOST_PREDEF_MAKE_N_N_N_000(V)` */ +#define BOOST_PREDEF_MAKE_N_N_N_000(V) BOOST_VERSION_NUMBER((V%1000000)/100000,(V%100000)/10000,(V%10000)/1000) +/*` `BOOST_PREDEF_MAKE_N_NN_000(V)` */ +#define BOOST_PREDEF_MAKE_N_NN_000(V) BOOST_VERSION_NUMBER((V%1000000)/100000,(V%100000)/1000,0) +/*` `BOOST_PREDEF_MAKE_NN_NN_00_NN_00(V)` */ +#define BOOST_PREDEF_MAKE_NN_NN_00_NN_00(V) BOOST_VERSION_NUMBER((V)/100000000,(V%100000000)/1000000,(V%10000)/100) +/*` `BOOST_PREDEF_MAKE_NN_00(V)` */ +#define BOOST_PREDEF_MAKE_NN_00(V) BOOST_VERSION_NUMBER((V)/100,0,0) +/*` `BOOST_PREDEF_MAKE_YYYY_MM_DD(V)` */ +#define BOOST_PREDEF_MAKE_YYYY_MM_DD(V) BOOST_VERSION_NUMBER((V)/10000-1970,(V%10000)/100,(V%100)) + +#endif diff --git a/boost/predef/os/aix.h b/boost/predef/os/aix.h index 8e872c6..f94d6ed 100644 --- a/boost/predef/os/aix.h +++ b/boost/predef/os/aix.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_AIX_H -#define BOOST_PREDEF_COMPILER_AIX_H +#ifndef BOOST_PREDEF_OS_AIX_H +#define BOOST_PREDEF_OS_AIX_H #include -#include +#include #define BOOST_OS_AIX BOOST_VERSION_NUMBER(0,0,0) @@ -28,4 +28,7 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_AIX,"AIX") + #endif diff --git a/boost/predef/os/amigaos.h b/boost/predef/os/amigaos.h index 9bd13a0..356fbb2 100644 --- a/boost/predef/os/amigaos.h +++ b/boost/predef/os/amigaos.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_AMIGAOS_H -#define BOOST_PREDEF_COMPILER_AMIGAOS_H +#ifndef BOOST_PREDEF_OS_AMIGAOS_H +#define BOOST_PREDEF_OS_AMIGAOS_H #include -#include +#include #define BOOST_OS_AMIGAOS BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_AMIGAOS BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_AMIGAOS,"Amiga OS") + #endif diff --git a/boost/predef/os/beos.h b/boost/predef/os/beos.h index 0e33fda..fd17f8a 100644 --- a/boost/predef/os/beos.h +++ b/boost/predef/os/beos.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_BEOS_H -#define BOOST_PREDEF_COMPILER_BEOS_H +#ifndef BOOST_PREDEF_OS_BEOS_H +#define BOOST_PREDEF_OS_BEOS_H #include -#include +#include #define BOOST_OS_BEOS BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_BEOS BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BEOS,"Be OS") + #endif diff --git a/boost/predef/os/bsd.h b/boost/predef/os/bsd.h index 09ca495..aedefda 100644 --- a/boost/predef/os/bsd.h +++ b/boost/predef/os/bsd.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_BSD_H -#define BOOST_PREDEF_COMPILER_BSD_H +#ifndef BOOST_PREDEF_OS_BSD_H +#define BOOST_PREDEF_OS_BSD_H #include -#include +#include #define BOOST_OS_BSD BOOST_VERSION_NUMBER(0,0,0) #define BOOST_OS_DRAGONFLY_BSD BOOST_VERSION_NUMBER(0,0,0) @@ -35,7 +35,7 @@ http://www.boost.org/LICENSE_1_0.txt) #elif defined(BSD4_4) #define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,4,0) #elif defined(BSD) - #define BOOST_OS_BSD BOOST_PREDEF_VRP_NN_NN(BSD) + #define BOOST_OS_BSD BOOST_PREDEF_MAKE_NN_NN(BSD) #else #define BOOST_OS_BSD BOOST_VERSION_NUMBER(0,0,1) #endif @@ -68,6 +68,9 @@ http://www.boost.org/LICENSE_1_0.txt) #elif defined(__NetBSD_Version) #define BOOST_OS_NET_BSD \ BOOST_PREDEF_VRP_NN_NN_00_NN_00(__NetBSD_Version) + #else + #define BOOST_OS_NET_BSD BOOST_VERSION_NUMBER(0,0,1) + #endif #endif #if defined(__OpenBSD__) #if defined(OpenBSD2_0) @@ -124,4 +127,12 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,"BSD") +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_DRAGONFLY_BSD,"Dragonfly BSD") +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_FREE_BSD,"Free BSD") +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSDI_BSD,"BSDI BSD") +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_NET_BSD,"Net BSD") +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_OPEN_BSD,"Open BSD") + #endif diff --git a/boost/predef/os/cygwin.h b/boost/predef/os/cygwin.h index 3d884e5..b16bb96 100644 --- a/boost/predef/os/cygwin.h +++ b/boost/predef/os/cygwin.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_CYGWIN_H -#define BOOST_PREDEF_COMPILER_CYGWIN_H +#ifndef BOOST_PREDEF_OS_CYGWIN_H +#define BOOST_PREDEF_OS_CYGWIN_H #include -#include +#include #define BOOST_OS_CYGWIN BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_CGYWIN BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_CYGWIN,"Cygwin") + #endif diff --git a/boost/predef/os/hpux.h b/boost/predef/os/hpux.h index b5f88de..0153bd7 100644 --- a/boost/predef/os/hpux.h +++ b/boost/predef/os/hpux.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_HPUX_H -#define BOOST_PREDEF_COMPILER_HPUX_H +#ifndef BOOST_PREDEF_OS_HPUX_H +#define BOOST_PREDEF_OS_HPUX_H #include -#include +#include #define BOOST_OS_HPUX BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_HPUX BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_HPUX,"HP-UX") + #endif diff --git a/boost/predef/os/irix.h b/boost/predef/os/irix.h index ecb0653..957f136 100644 --- a/boost/predef/os/irix.h +++ b/boost/predef/os/irix.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_IRIX_H -#define BOOST_PREDEF_COMPILER_IRIX_H +#ifndef BOOST_PREDEF_OS_IRIX_H +#define BOOST_PREDEF_OS_IRIX_H #include -#include +#include #define BOOST_OS_IRIX BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_IRIX BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IRIX,"Irix") + #endif diff --git a/boost/predef/os/linux.h b/boost/predef/os/linux.h index 2f5af86..9161ed4 100644 --- a/boost/predef/os/linux.h +++ b/boost/predef/os/linux.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_H -#define BOOST_PREDEF_COMPILER_H +#ifndef BOOST_PREDEF_OS_LINUX_H +#define BOOST_PREDEF_OS_LINUX_H #include -#include +#include #define BOOST_OS_LINUX BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_LINUX BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_LINUX,"Linux") + #endif diff --git a/boost/predef/os/macos.h b/boost/predef/os/macos.h index 2732853..5128c7e 100644 --- a/boost/predef/os/macos.h +++ b/boost/predef/os/macos.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_H -#define BOOST_PREDEF_COMPILER_H +#ifndef BOOST_PREDEF_OS_MACOS_H +#define BOOST_PREDEF_OS_MACOS_H #include -#include +#include #define BOOST_OS_MACOS BOOST_VERSION_NUMBER(0,0,0) @@ -23,4 +23,7 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_MACOS,"MacOS") + #endif diff --git a/boost/predef/os/qnxnto.h b/boost/predef/os/qnxnto.h index 147da29..d41c680 100644 --- a/boost/predef/os/qnxnto.h +++ b/boost/predef/os/qnxnto.h @@ -5,18 +5,18 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_H -#define BOOST_PREDEF_COMPILER_H +#ifndef BOOST_PREDEF_OS_QNXNTO_H +#define BOOST_PREDEF_OS_QNXNTO_H #include -#include +#include #define BOOST_OS_QNX BOOST_VERSION_NUMBER(0,0,0) #if defined(__QNX__) || defined(__QNXNTO__) #undef BOOST_OS_QNX #if defined(_NTO_VERSION) - #define BOOST_OS_QNX BOOST_PREDEF_VRP_NN_NN(_NTO_VERSION) + #define BOOST_OS_QNX BOOST_PREDEF_MAKE_NN_NN(_NTO_VERSION) #elif defined(__QNX__) #define BOOST_OS_QNX BOOST_VERSION_NUMBER(4,0,0) #else @@ -24,4 +24,7 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_QNX,"QNX-NTO") + #endif diff --git a/boost/predef/os/solaris.h b/boost/predef/os/solaris.h index 501afad..128e8f1 100644 --- a/boost/predef/os/solaris.h +++ b/boost/predef/os/solaris.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_H -#define BOOST_PREDEF_COMPILER_H +#ifndef BOOST_PREDEF_OS_SOLARIS_H +#define BOOST_PREDEF_OS_SOLARIS_H #include -#include +#include #define BOOST_OS_SOLARIS BOOST_VERSION_NUMBER(0,0,0) @@ -18,4 +18,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_SOLARIS BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_SOLARIS,"Solaris") + #endif diff --git a/boost/predef/os/unix.h b/boost/predef/os/unix.h index f247ff9..fd76f34 100644 --- a/boost/predef/os/unix.h +++ b/boost/predef/os/unix.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_H -#define BOOST_PREDEF_COMPILER_H +#ifndef BOOST_PREDEF_OS_UNIX_H +#define BOOST_PREDEF_OS_UNIX_H #include -#include +#include #define BOOST_OS_UNIX BOOST_VERSION_NUMBER(0,0,0) @@ -19,4 +19,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_UNIX BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_UNIX,"Unix") + #endif diff --git a/boost/predef/os/windows.h b/boost/predef/os/windows.h index ec57697..400067f 100644 --- a/boost/predef/os/windows.h +++ b/boost/predef/os/windows.h @@ -5,11 +5,11 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_COMPILER_H -#define BOOST_PREDEF_COMPILER_H +#ifndef BOOST_PREDEF_OS_WINDOWS_H +#define BOOST_PREDEF_OS_WINDOWS_H #include -#include +#include #define BOOST_OS_WINDOWS BOOST_VERSION_NUMBER(0,0,0) @@ -19,4 +19,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_WINDOWS BOOST_VERSION_NUMBER(0,0,1) #endif +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_WINDOWS,"Windows") + #endif diff --git a/boost/predef/version_number.h b/boost/predef/version_number.h index 9fef20b..cac089f 100644 --- a/boost/predef/version_number.h +++ b/boost/predef/version_number.h @@ -1,6 +1,6 @@ /* Copyright Rene Rivera 2005 -Copyright Redshift Software, Inc. 2008-2010 +Copyright Redshift Software, Inc. 2008-2011 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,14 +9,31 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_VERSION_NUMBER_H #define BOOST_PREDEF_VERSION_NUMBER_H -/* -/// Defines standard version numbers, with these properties: -/// * Decimal base whole numbers in the range [0,major*10000000] -/// * The number range is designed to allow for a (2,2,5) triplet. -/// Which fits within a 32 bit value. -/// * Values can be specified in any base. +/*` +[heading BOOST_VERSION_NUMBER] + +`` +BOOST_VERSION_NUMBER(major,minor,patch) +`` + +Defines standard version numbers, with these properties: + +* Decimal base whole numbers in the range [0,major*10000000]. + The number range is designed to allow for a (2,2,5) triplet. + Which fits within a 32 bit value. +* The `major` number can be in the [0,99] range. +* The `minor` number can be in the [0,99] range. +* The `patch` number can be in the [0,99999] range. +* Values can be specified in any base. As the defined value + is an constant expression. +* Value can be directly used in both preprocessor and compiler + expressions for comparison to other similarly defined values. +* The implementation enforces the individual ranges for the + major, minor, and patch numbers. And values over the ranges + are truncated (modulo). + */ #define BOOST_VERSION_NUMBER(major,minor,patch) \ - ( ((major)*10000000) + ((minor)*100000) + (patch) ) + ( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) ) #endif diff --git a/jamroot.jam b/jamroot.jam new file mode 100644 index 0000000..cc14498 --- /dev/null +++ b/jamroot.jam @@ -0,0 +1,10 @@ +# Copyright Redshift Software Inc. 2011 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +project predef + : build-dir bin + ; + +path-constant BOOST_PREDEF_ROOT : . ; diff --git a/libs/predef/doc/build.jam b/libs/predef/doc/build.jam new file mode 100644 index 0000000..2833e60 --- /dev/null +++ b/libs/predef/doc/build.jam @@ -0,0 +1,38 @@ +# Copyright Redshift Software, Inc. 2011 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +using quickbook ; + +if ! $(BOOST_ROOT) +{ + BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ; +} + +xml predef + : + predef.qbk + ; +explicit predef ; + +boostbook standalone + : + predef + : + boost.root=../../.. + generate.section.toc.level=3 + chunk.section.depth=1 + chunk.first.sections=1 + + images + callouts + css + ; + +install images : [ glob $(BOOST_ROOT)/doc/src/images/*.png ] : html/images ; +explicit images ; +install callouts : [ glob $(BOOST_ROOT)/doc/src/images/callouts/*.png ] : html/images/callouts ; +explicit callouts ; +install css : [ glob $(BOOST_ROOT)/doc/src/*.css ] : html ; +explicit css ; diff --git a/libs/predef/doc/predef.qbk b/libs/predef/doc/predef.qbk new file mode 100644 index 0000000..99f6964 --- /dev/null +++ b/libs/predef/doc/predef.qbk @@ -0,0 +1,236 @@ +[article Predef + [quickbook 1.6] + [version 1.0] + [authors [Rivera, Rene]] + [copyright 2005 Rene Rivera, 2008-2011 Redshift Software Inc] + [purpose Identification and specification of predefined macros.] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] + [source-mode teletype] +] + +[section Introduction] + +This library defines a set of compiler, architecture, operating system, +and library version numbers from the information it can gather of C++ +predefined macros or those defined in generally available headers. The +idea for this library grew out of a proposal to extend the Boost Config +library to provide more, and consistent, information than the feature +definitions it supports. What follows is an edited version of that brief +proposal. + +[heading Proposal] + +The idea is to define a set of macros to identify compilers and +consistently represent their version. This includes: + +* A unique BOOST_VERSION_NUMBER(major,minor,patch) macro to specify version + numbers (unfortunately, the name BOOST_VERSION is already taken to designate + the version number of boost itself). +* A compiler identification macro, suitable for use in #if/#elif directives, + for each of the supported compilers. All macros would be defined, regardless + of the compiler. The one macro corresponding to the compiler being used would + be defined, in terms of BOOST_VERSION_NUMBER, to carry the exact compiler + version. All other macros would expand to an expression evaluating to false + (for instance, the token 0) to indicate that the corresponding compiler is not + present. +* "Null values" could be set, for all macros, in + boost/config/select_compiler.hpp; then, for each compiler the corresponding + identification macro would be #undef and re-#defined in the corresponding + boost/compiler/(cc).hpp; however in the context of the Boost.Config + infrastructure using a "prefix" header (to be introduced) or + boost/config/suffix.hpp is a better solution. This point is further + clarified later. + +[heading Current Library] + +The current Predef library is now, both an independent library, and expanded +in scope. It includes detection and definition of architectures, compilers, +libraries, and operating systems. The key benefits are: + +* Version numbers that are always defined so that one doesn't have to guard + with `#ifdef`. +* All possible definitions are included with the single `#include ` + so that it's friendly to precompiled header usage. +* Predefs can be directly used in both preprocessor and compiler expressions + for comparison to other similarly defined values. +* The headers are usable from multiple languages, that support the C preprocessor. + In particular C++, C, Objective C, and Objective C++. + +[heading Design choices] + +An important design choice concerns how to represent compiler versions by means +of a single integer number suitable for use in preprocessing directives. Let's +do some calculation. The "basic" signed type for preprocessing +constant-expressions is long in C90 (and C++, as of 2006) and intmax_t in C99. +The type long shall at least be able to represent the number [^+2 147 483 647]. +This means the most significant digit can only be 0, 1 or 2; and if we want all +decimal digits to be able to vary between 0 and 9, the largest range we can +consider is [^\[0, 999 999 999\]]. Distributing evenly, this means 3 decimal +digits for each version number part. + +So we can: + +# use an uneven distribution or +# use more bits (a larger type) or +# use 3/3/3 and have the particular compiler/platform/stdlib deal with setting + the numbers within the 3-digit range. + +It appears relatively safe to go for the first option and set it at 2/2/5. That +covers CodeWarrior and others, which are up to and past 10 for the major number. +Some compilers use the build number in lieu of the patch one; five digits +(which is already reached by VC++ 8) seems a reasonable limit even in this case. + +[note A 2/2/6 scheme would allow for bigger patch/build numbers at the cost, +for instance, of limiting the major version number to 20 (or, with further +constraints, to 21).] + +It might reassure the reader that this decision is actually encoded in one place +in the code; the definition of BOOST_VERSION_NUMBER. + +[heading Future work] + +Even though the basics of this library are done, there is much work that can be +done: + +* Right now we limit the detection of libraries to known built-in predefined + macros, and to guaranteed to exist system and library headers. It might be + interesting to add something like auto-configuration predefs. This way we can + add definitions for user specific libraries and features. +* Along with the above, it might be good to add some user control as to which + headers are included with the top-level header. +* Additionally, even if there is no auto-configure style option.. It would be + good to add optionally included headers so that user can get consistent + version number definitions for libraries they use. +* Having a consistent set of version number definitions opens the door to + improving the user level syntax of libraries that do checks against version + numbers. Specifically Boost Config's `BOOST_WORKAROUND` macro would benefit + from a more readable syntax. As would the `BOOST_TESTED_AT` detail macro. +* And obviously there's lots of work to do in reformulating the existing + Boost libraries to use the Predef library once it's accepted. +* And there's the continuing work of adding definitions for present and + future compilers, platforms, architectures, and libraries. + +[endsect] [/Introduction] + +[section Using the predefs] + +To use the automatically defined predefs one needs to only include the +single top-level header: + +`` + #include +`` + +This defines [*all] the version macros known to the library. For each +macro it will be defined to either a /zero/ valued expression for when +the particular item is not detected, and to a /positive/ value if it +is detected. The predef macros fall onto the four categories each with +macros of a particular prefix: + +* `BOOST_ARCHITECTURE_`for system/CPU architecture one is compiling for. +* `BOOST_CXX_` for the compiler one is using. +* `BOOST_LIBC_` and `BOOST_LIBSTD_` for the C and C++ standard library + in use. +* `BOOST_OS_` for the operating system we are compiling to. + +[note The detected definitions are for the configuration one is targeting +during the compile. In particular in a cross-compile this means the target +system, and not the host system.] + +`` + #include + #include + + #if (APPLICATION_VERSION >= BOOST_VERSION_NUMBER(1,0,0)) + bool application_is_at_least_version_1 = true; + #else + bool application_is_at_least_version_1 = false; + #endif + + int main() + { + if (application_is_at_least_version_1) + std::cout << "Application is at least version 1.0.0" << std::endl; + if (APPLICATION_VERSION >= BOOST_VERSION_NUMBER(2,0,0)) + std::cout << "Application is at least version 2.0.0" << std::endl; + return 0; + } +`` + +[heading Using existing version predefs] + +[heading Using the `BOOST_VERSION_NUMBER` macro] + +[endsect] + +[section Adding new predefs] + +[heading Requirements of the header] + +[heading Structure of the header] + +`` +/* +Copyright Jane Doe 20xx +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_category_tag_H +#define BOOST_PREDEF_category_tag_H + +#include +#include + +#define BOOST_category_tag BOOST_VERSION_NUMBER(0,0,0) + +#if defined(condition) + #undef BOOST_category_tag + #if defined(condition) + #define BOOST_category_tag BOOST_VERSION_NUMBER(1,0,0) + #elif defined(__alpha_ev5__) + #define BOOST_category_tag BOOST_VERSION_NUMBER(2,0,0) + #else + #define BOOST_category_tag BOOST_VERSION_NUMBER(0,0,1) + #endif +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_categiry_tag,"Name") + +#endif +`` + +[heading Using utility pattern macros] + +[endsect] + +[section Reference] + +[section `BOOST_ARCHITECTURE_` architecture macros] +[/import ../../../boost/predef/architecture/.*\.h] +[endsect] + +[section `BOOST_CXX_` compiler macros] +[/import ../../../boost/predef/compiler/.*\.h] +[endsect] + +[section `BOOST_LIBC_` and `BOOST_LIBSTD_` library macros] +[/import ../../../boost/predef/library/.*/.*\.h] +[endsect] + +[section `BOOST_OS_` operating system macros] +[/import ../../../boost/predef/os/.*\.h] +[endsect] + +[section Version definition macros] +[include ../../../boost/predef/version_number.h] +[include ../../../boost/predef/make.h] +[endsect] + +[endsect] diff --git a/libs/predef/test/build.jam b/libs/predef/test/build.jam new file mode 100644 index 0000000..2d8276a --- /dev/null +++ b/libs/predef/test/build.jam @@ -0,0 +1,19 @@ +# Copyright Redshift Software, Inc. 2011 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +project test + : requirements + $(BOOST_PREDEF_ROOT) + $(BOOST_PREDEF_ROOT)/boost/predef.h + ; + +using testing ; + +run info_as_cpp.cpp ; +run info_as_c.c ; +run info_as_objcpp.mm ; +run info_as_objc.m ; +run version.cpp ; +run make.cpp ; diff --git a/libs/predef/test/info_as_c.c b/libs/predef/test/info_as_c.c new file mode 100644 index 0000000..134f8b5 --- /dev/null +++ b/libs/predef/test/info_as_c.c @@ -0,0 +1,76 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include +#include +#include + +#define BOOST_PREDEF_INTERNAL_GENERATE_TESTS + +typedef struct predef_info +{ + unsigned tag; + char * name; + char * description; + unsigned value; +} predef_info; + +predef_info first_predef_info = { 0x43210DEF , "-" , "-" , 0xFFFFFFFF }; + +#define BOOST_PREDEF_DECLARE_TEST(x,s) \ + predef_info x##_predef_info = { 0x67890DEF , #x , s , x }; +#include + +predef_info last_predef_info = { 0xFFFFFFFF , "-" , "-" , 0x43210DEF }; + +int predef_info_compare(const void * a, const void * b) +{ + const predef_info ** i = (const predef_info **)a; + const predef_info ** j = (const predef_info **)b; + return strcmp((*i)->name,(*j)->name); +} + +int main() +{ + predef_info ** predefs = 0; + unsigned predef_count = 0; + unsigned * i = &first_predef_info.tag; + unsigned * e = &last_predef_info.tag; + while (i < e) + { + i += 1; + if (*i == 0x67890DEF) + { + predef_count += 1; + predefs = realloc(predefs,predef_count*sizeof(predef_info*)); + predefs[predef_count-1] = (predef_info*)i; + } + } + qsort(predefs,predef_count,sizeof(predef_info*),predef_info_compare); + int x = 0; + puts("** Detected **"); + for (x = 0; x < predef_count; ++x) + { + if (predefs[x]->value > 0) + printf("%s = %u (%u,%u,%u) | %s\n", + predefs[x]->name, + predefs[x]->value, + (predefs[x]->value/10000000)%100, + (predefs[x]->value/100000)%100, + (predefs[x]->value)%100000, + predefs[x]->description); + } + puts("** Not Detected **"); + for (x = 0; x < predef_count; ++x) + { + if (predefs[x]->value == 0) + printf("%s = %u | %s\n", + predefs[x]->name, + predefs[x]->value, + predefs[x]->description); + } + return 0; +} diff --git a/libs/predef/test/info_as_cpp.cpp b/libs/predef/test/info_as_cpp.cpp new file mode 100644 index 0000000..ad05fd4 --- /dev/null +++ b/libs/predef/test/info_as_cpp.cpp @@ -0,0 +1,90 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include +#include +#include + +#define BOOST_PREDEF_INTERNAL_GENERATE_TESTS + +namespace +{ + struct predef_info + { + std::string name; + std::string description; + unsigned value; + + predef_info( + std::string const & n, + std::string const & d, + unsigned v); + + predef_info( + predef_info const & other) + : name(other.name) + , description(other.description) + , value(other.value) + { + } + + bool operator < (predef_info const & other) const + { + return name < other.name; + } + }; + + std::set * predefs = 0; + + predef_info::predef_info( + std::string const & n, + std::string const & d, + unsigned v) + : name(n) + , description(d) + , value(v) + { + if (!predefs) + { + predefs = new std::set(); + } + predefs->insert(*this); + } +} + +#define BOOST_PREDEF_DECLARE_TEST(x,s) \ + namespace { \ + predef_info x##_predef_init(#x,s,x); \ + } +#include + +int main() +{ + std::set::iterator i; + std::set::iterator e = predefs->end(); + std::cout << "** Detected **" << std::endl; + for (i = predefs->begin(); i != e; ++i) + { + if (i->value > 0) + std::cout + << i->name << " = " + << i->value + << " (" << (i->value/10000000)%100 << "," << (i->value/100000)%100 << "," << (i->value)%100000 << ") | " + << i->description + << std::endl; + } + std::cout << "** Not Detected **" << std::endl; + for (i = predefs->begin(); i != e; ++i) + { + if (i->value == 0) + std::cout + << i->name << " = " + << i->value << " | " + << i->description + << std::endl; + } + return 0; +} diff --git a/libs/predef/test/info_as_objc.m b/libs/predef/test/info_as_objc.m new file mode 100644 index 0000000..ce1d08e --- /dev/null +++ b/libs/predef/test/info_as_objc.m @@ -0,0 +1,7 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include "info_as_c.c" diff --git a/libs/predef/test/info_as_objcpp.mm b/libs/predef/test/info_as_objcpp.mm new file mode 100644 index 0000000..2176eea --- /dev/null +++ b/libs/predef/test/info_as_objcpp.mm @@ -0,0 +1,7 @@ +/* +Copyright Redshift Software Inc. 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include "info_as_cpp.cpp" diff --git a/libs/predef/test/make.cpp b/libs/predef/test/make.cpp new file mode 100644 index 0000000..acb4046 --- /dev/null +++ b/libs/predef/test/make.cpp @@ -0,0 +1,78 @@ +/* +Copyright Redshift Software Inc 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include +#include +#include +#include +#include +#include + +namespace +{ + struct test_info + { + std::string value; + bool passed; + + test_info(std::string const & v, bool p) : value(v), passed(p) {} + test_info(test_info const & o) : value(o.value), passed(o.passed) {} + }; + + std::vector test_results; +} + +#define PREDEF_CHECK(X) test_results.push_back(test_info(#X,(X))) + +void test_BOOST_VERSION_NUMBER() +{ + PREDEF_CHECK(BOOST_PREDEF_MAKE_F_F_F(0xFFF) == BOOST_VERSION_NUMBER(0xF,0xF,0xF)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_FF_F_F(0xFFFF) == BOOST_VERSION_NUMBER(0xFF,0xF,0xF)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_F_F_FF(0xFFFF) == BOOST_VERSION_NUMBER(0xF,0xF,0xFF)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_FF_FF(0xFFFF) == BOOST_VERSION_NUMBER(0xFF,0xFF,0x0)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_F_FF_FFFF(0xFFFFFFF) == BOOST_VERSION_NUMBER(0xF,0xFF,0xFFFF)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_FF_FF_F(0xFFFFF) == BOOST_VERSION_NUMBER(0xFF,0xFF,0xF)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_F_FF_FF_000(0xFFFFF000) == BOOST_VERSION_NUMBER(0xF,0xFF,0xFF)); + + PREDEF_CHECK(BOOST_PREDEF_MAKE_N_N_N(999) == BOOST_VERSION_NUMBER(9,9,9)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_NN_NN_NN(999999) == BOOST_VERSION_NUMBER(99,99,99)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_NN_NN(9999) == BOOST_VERSION_NUMBER(99,99,0)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_N_N_NN(9999) == BOOST_VERSION_NUMBER(9,9,99)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_N_NN_NN(99999) == BOOST_VERSION_NUMBER(9,99,99)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_N_N_N_000(999000) == BOOST_VERSION_NUMBER(9,9,9)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_N_NN_000(999000) == BOOST_VERSION_NUMBER(9,99,0)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_NN_NN_00_NN_00(9999009900) == BOOST_VERSION_NUMBER(99,99,99)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_NN_00(9900) == BOOST_VERSION_NUMBER(99,00,00)); + + PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYY_MM_DD(19700101) == BOOST_VERSION_NUMBER(0,1,1)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYY_MM_DD(19710101) == BOOST_VERSION_NUMBER(1,1,1)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_YYYY_MM_DD(20691231) == BOOST_VERSION_NUMBER(99,12,31)); +} + +int main() +{ + test_BOOST_VERSION_NUMBER(); + + unsigned fail_count = 0; + std::vector::iterator i = test_results.begin(); + std::vector::iterator e = test_results.end(); + for (; i != e; ++i) + { + std::cout + << (i->passed ? "[passed]" : "[failed]") + << " " << i->value + << std::endl; + fail_count += i->passed ? 0 : 1; + } + std::cout + << std::endl + << "TOTAL: " + << "passed " << (test_results.size()-fail_count) << ", " + << "failed " << (fail_count) << ", " + << "of " << (test_results.size()) + << std::endl; + return fail_count; +} diff --git a/libs/predef/test/version.cpp b/libs/predef/test/version.cpp new file mode 100644 index 0000000..b920207 --- /dev/null +++ b/libs/predef/test/version.cpp @@ -0,0 +1,62 @@ +/* +Copyright Redshift Software Inc 2011 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include +#include +#include +#include +#include + +namespace +{ + struct test_info + { + std::string value; + bool passed; + + test_info(std::string const & v, bool p) : value(v), passed(p) {} + test_info(test_info const & o) : value(o.value), passed(o.passed) {} + }; + + std::vector test_results; +} + +#define PREDEF_CHECK(X) test_results.push_back(test_info(#X,(X))) + +void test_BOOST_VERSION_NUMBER() +{ + PREDEF_CHECK(BOOST_VERSION_NUMBER(0,0,1) == 1L); + PREDEF_CHECK(BOOST_VERSION_NUMBER(99,99,99999) == 999999999L); + PREDEF_CHECK(BOOST_VERSION_NUMBER(299,99,99999) != 2999999999L); + PREDEF_CHECK(BOOST_VERSION_NUMBER(100,99,99999) != 1009999999L); + PREDEF_CHECK(BOOST_VERSION_NUMBER(100,99,99999) == 9999999L); + PREDEF_CHECK(BOOST_VERSION_NUMBER(100,100,100000) == 0L); +} + +int main() +{ + test_BOOST_VERSION_NUMBER(); + + unsigned fail_count = 0; + std::vector::iterator i = test_results.begin(); + std::vector::iterator e = test_results.end(); + for (; i != e; ++i) + { + std::cout + << (i->passed ? "[passed]" : "[failed]") + << " " << i->value + << std::endl; + fail_count += i->passed ? 0 : 1; + } + std::cout + << std::endl + << "TOTAL: " + << "passed " << (test_results.size()-fail_count) << ", " + << "failed " << (fail_count) << ", " + << "of " << (test_results.size()) + << std::endl; + return fail_count; +}