diff --git a/check/predef_check.h b/check/predef_check.h new file mode 100644 index 0000000..a6917c1 --- /dev/null +++ b/check/predef_check.h @@ -0,0 +1,98 @@ +/* +Copyright Rene Rivera 2011-2015 +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 + +const char * str_token(const char ** str, const char * space) +{ + unsigned span; + char * token; + for (; **str != 0; *str += 1) + { + if (0 == strchr(space, **str)) + { + break; + } + } + span = strcspn(*str, space); + token = (char *)malloc(span+1); + strncpy(token, *str, span); + token[span] = 0; + for (*str += span; **str != 0; *str += 1) + { + if (0 == strchr(space, **str)) + { + break; + } + } + return token; +} + +const char * whitespace = " "; +const char * dot = "."; + +int main(int argc, const char ** argv) +{ + unsigned x = 0; + int argi = 1; + create_predef_entries(); +#if 0 + qsort(generated_predef_info,generated_predef_info_count, + sizeof(predef_info),predef_info_compare); + for (x = 0; x < generated_predef_info_count; ++x) + { + printf("%s: %d\n", generated_predef_info[x].name, generated_predef_info[x].value); + } +#endif + int result = -1; + for (argi = 1; argi < argc; ++argi) + { + const char * exp = argv[argi]; + const char * exp_name = str_token(&exp, whitespace); + const char * exp_op = str_token(&exp, whitespace); + const char * exp_val = str_token(&exp, whitespace); + unsigned exp_version = 0; + if (*exp_val != 0) + { + exp = exp_val; + const char * exp_val_a = str_token(&exp, dot); + const char * exp_val_b = str_token(&exp, dot); + const char * exp_val_c = str_token(&exp, dot); + exp_version = BOOST_VERSION_NUMBER(atoi(exp_val_a), atoi(exp_val_b),atoi(exp_val_c)); + } + for (x = 0; x < generated_predef_info_count; ++x) + { + if (*exp_op == 0 && + generated_predef_info[x].value > 0 && + strcmp(exp_name, generated_predef_info[x].name) == 0) + { + /* Expression of the form "BOOST_x_yy" is true. */ + result = 0; + break; + } + else if (*exp_op == 0 && + generated_predef_info[x].value == 0 && + strcmp(exp_name, generated_predef_info[x].name) == 0) + { + /* Expression of the form "BOOST_x_yy" is false. */ + return argi; + } + else if (*exp_op != 0 && *exp_val != 0 && + strcmp(exp_name, generated_predef_info[x].name) == 0) + { + /* Expression of the form "BOOST_x_yy op val". */ + result = 0; + if (0 == strcmp(">",exp_op) && !(generated_predef_info[x].value > exp_version)) return argi; + if (0 == strcmp("<",exp_op) && !(generated_predef_info[x].value < exp_version)) return argi; + if (0 == strcmp(">=",exp_op) && !(generated_predef_info[x].value >= exp_version)) return argi; + if (0 == strcmp("<=",exp_op) && !(generated_predef_info[x].value <= exp_version)) return argi; + if (0 == strcmp("==",exp_op) && !(generated_predef_info[x].value == exp_version)) return argi; + if (0 == strcmp("!=",exp_op) && !(generated_predef_info[x].value != exp_version)) return argi; + } + } + } + return result; +} diff --git a/check/predef_check_as_c.c b/check/predef_check_as_c.c index dcb7d6a..352c18b 100644 --- a/check/predef_check_as_c.c +++ b/check/predef_check_as_c.c @@ -4,116 +4,4 @@ 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; - const char * name; - const 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); -} - -const char * str_token(const char ** str, const char * space) -{ - unsigned span; - char * token; - for (; **str != 0; *str += 1) - { - if (0 == strchr(space, **str)) - { - break; - } - } - span = strcspn(*str, space); - token = (char *)malloc(span+1); - strncpy(token, *str, span); - token[span] = 0; - for (*str += span; **str != 0; *str += 1) - { - if (0 == strchr(space, **str)) - { - break; - } - } - return token; -} - -const char * whitespace = " "; -const char * dot = "."; - -int main(int argc, const char ** argv) -{ - unsigned x = 0; - int argi = 1; - 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 = (predef_info**)realloc(predefs,predef_count*sizeof(predef_info*)); - predefs[predef_count-1] = (predef_info*)i; - } - } - qsort(predefs,predef_count,sizeof(predef_info*),predef_info_compare); - for (argi = 1; argi < argc; ++argi) - { - const char * exp = argv[argi]; - const char * exp_name = str_token(&exp, whitespace); - const char * exp_op = str_token(&exp, whitespace); - const char * exp_val = str_token(&exp, whitespace); - unsigned exp_version = 0; - if (*exp_val != 0) - { - exp = exp_val; - const char * exp_val_a = str_token(&exp, dot); - const char * exp_val_b = str_token(&exp, dot); - const char * exp_val_c = str_token(&exp, dot); - exp_version = BOOST_VERSION_NUMBER(atoi(exp_val_a), atoi(exp_val_b),atoi(exp_val_c)); - } - for (x = 0; x < predef_count; ++x) - { - if (*exp_op == 0 && - predefs[x]->value == 0 && - strcmp(exp_name, predefs[x]->name) == 0) - { - return argi; - } - else if (*exp_op != 0 && *exp_val != 0 && - strcmp(exp_name, predefs[x]->name) == 0) - { - if (0 == strcmp(">",exp_op) && !(predefs[x]->value > exp_version)) return argi; - if (0 == strcmp("<",exp_op) && !(predefs[x]->value < exp_version)) return argi; - if (0 == strcmp(">=",exp_op) && !(predefs[x]->value >= exp_version)) return argi; - if (0 == strcmp("<=",exp_op) && !(predefs[x]->value <= exp_version)) return argi; - if (0 == strcmp("==",exp_op) && !(predefs[x]->value == exp_version)) return argi; - if (0 == strcmp("!=",exp_op) && !(predefs[x]->value != exp_version)) return argi; - } - } - } - return 0; -} +#include "predef_check.h" diff --git a/check/predef_check_as_cpp.cpp b/check/predef_check_as_cpp.cpp index c58abe7..352c18b 100644 --- a/check/predef_check_as_cpp.cpp +++ b/check/predef_check_as_cpp.cpp @@ -1 +1,7 @@ -#include "predef_check_as_c.c" +/* +Copyright Rene Rivera 2011-2015 +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 "predef_check.h" diff --git a/check/predef_check_as_objc.m b/check/predef_check_as_objc.m index c58abe7..352c18b 100644 --- a/check/predef_check_as_objc.m +++ b/check/predef_check_as_objc.m @@ -1 +1,7 @@ -#include "predef_check_as_c.c" +/* +Copyright Rene Rivera 2011-2015 +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 "predef_check.h" diff --git a/check/predef_check_as_objcpp.mm b/check/predef_check_as_objcpp.mm index c58abe7..352c18b 100644 --- a/check/predef_check_as_objcpp.mm +++ b/check/predef_check_as_objcpp.mm @@ -1 +1,7 @@ -#include "predef_check_as_c.c" +/* +Copyright Rene Rivera 2011-2015 +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 "predef_check.h" diff --git a/include/boost/predef.h b/include/boost/predef.h index 753cd61..71b1913 100644 --- a/include/boost/predef.h +++ b/include/boost/predef.h @@ -1,12 +1,14 @@ /* -Copyright Rene Rivera 2008-2013 +Copyright Rene Rivera 2008-2015 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) */ +#if !defined(BOOST_PREDEF_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_H #define BOOST_PREDEF_H +#endif #include #include diff --git a/include/boost/predef/architecture.h b/include/boost/predef/architecture.h index b32701e..c433d43 100644 --- a/include/boost/predef/architecture.h +++ b/include/boost/predef/architecture.h @@ -1,12 +1,14 @@ /* -Copyright Rene Rivera 2008-2013 +Copyright Rene Rivera 2008-2015 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) */ +#if !defined(BOOST_PREDEF_ARCHITECTURE_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_ARCHITECTURE_H #define BOOST_PREDEF_ARCHITECTURE_H +#endif #include #include diff --git a/include/boost/predef/architecture/alpha.h b/include/boost/predef/architecture/alpha.h index 6365ec4..371b921 100644 --- a/include/boost/predef/architecture/alpha.h +++ b/include/boost/predef/architecture/alpha.h @@ -53,8 +53,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_ALPHA_NAME "DEC Alpha" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_ALPHA,BOOST_ARCH_ALPHA_NAME) - - -#endif diff --git a/include/boost/predef/architecture/arm.h b/include/boost/predef/architecture/arm.h index 4974895..7b0c3c2 100644 --- a/include/boost/predef/architecture/arm.h +++ b/include/boost/predef/architecture/arm.h @@ -64,8 +64,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_ARM_NAME "ARM" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_ARM,BOOST_ARCH_ARM_NAME) - - -#endif diff --git a/include/boost/predef/architecture/blackfin.h b/include/boost/predef/architecture/blackfin.h index ae3407e..166e6aa 100644 --- a/include/boost/predef/architecture/blackfin.h +++ b/include/boost/predef/architecture/blackfin.h @@ -40,8 +40,7 @@ Blackfin Processors from Analog Devices. #define BOOST_ARCH_BLACKFIN_NAME "Blackfin" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_BLACKFIN,BOOST_ARCH_BLACKFIN_NAME) - - -#endif diff --git a/include/boost/predef/architecture/convex.h b/include/boost/predef/architecture/convex.h index 3b425a0..0c4f4a2 100644 --- a/include/boost/predef/architecture/convex.h +++ b/include/boost/predef/architecture/convex.h @@ -59,9 +59,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_CONVEX_NAME "Convex Computer" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_CONVEX,BOOST_ARCH_CONVEX_NAME) - - - -#endif diff --git a/include/boost/predef/architecture/ia64.h b/include/boost/predef/architecture/ia64.h index 4b5a103..8bccbc8 100644 --- a/include/boost/predef/architecture/ia64.h +++ b/include/boost/predef/architecture/ia64.h @@ -43,7 +43,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_IA64_NAME "Intel Itanium 64" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_IA64,BOOST_ARCH_IA64_NAME) - -#endif diff --git a/include/boost/predef/architecture/m68k.h b/include/boost/predef/architecture/m68k.h index 09c3cd3..bf48ddb 100644 --- a/include/boost/predef/architecture/m68k.h +++ b/include/boost/predef/architecture/m68k.h @@ -76,8 +76,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_M68K_NAME "Motorola 68k" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_M68K,BOOST_ARCH_M68K_NAME) - - -#endif diff --git a/include/boost/predef/architecture/mips.h b/include/boost/predef/architecture/mips.h index ae88428..e1a42fa 100644 --- a/include/boost/predef/architecture/mips.h +++ b/include/boost/predef/architecture/mips.h @@ -67,8 +67,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_MIPS_NAME "MIPS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_MIPS,BOOST_ARCH_MIPS_NAME) - - -#endif diff --git a/include/boost/predef/architecture/parisc.h b/include/boost/predef/architecture/parisc.h index e843dd2..06c7079 100644 --- a/include/boost/predef/architecture/parisc.h +++ b/include/boost/predef/architecture/parisc.h @@ -58,8 +58,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_PARISC_NAME "HP/PA RISC" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_PARISC,BOOST_ARCH_PARISC_NAME) - - -#endif diff --git a/include/boost/predef/architecture/ppc.h b/include/boost/predef/architecture/ppc.h index cc743e7..3c1ae4f 100644 --- a/include/boost/predef/architecture/ppc.h +++ b/include/boost/predef/architecture/ppc.h @@ -66,8 +66,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_PPC_NAME "PowerPC" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_PPC,BOOST_ARCH_PPC_NAME) - - -#endif diff --git a/include/boost/predef/architecture/pyramid.h b/include/boost/predef/architecture/pyramid.h index 26d5293..dfd8eb6 100644 --- a/include/boost/predef/architecture/pyramid.h +++ b/include/boost/predef/architecture/pyramid.h @@ -36,8 +36,7 @@ Pyramid 9810 architecture. #define BOOST_ARCH_PYRAMID_NAME "Pyramid 9810" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_PYRAMID,BOOST_ARCH_PYRAMID_NAME) - - -#endif diff --git a/include/boost/predef/architecture/rs6k.h b/include/boost/predef/architecture/rs6k.h index 20dd64b..9b37690 100644 --- a/include/boost/predef/architecture/rs6k.h +++ b/include/boost/predef/architecture/rs6k.h @@ -42,9 +42,6 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_RS6000_NAME "RS/6000" -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_RS6000,BOOST_ARCH_RS6000_NAME) - #define BOOST_ARCH_PWR BOOST_ARCH_RS6000 #if BOOST_ARCH_PWR @@ -54,3 +51,6 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_RS6000,BOOST_ARCH_RS6000_NAME) #define BOOST_ARCH_PWR_NAME BOOST_ARCH_RS6000_NAME #endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_RS6000,BOOST_ARCH_RS6000_NAME) diff --git a/include/boost/predef/architecture/sparc.h b/include/boost/predef/architecture/sparc.h index 9c91cda..d7580f5 100644 --- a/include/boost/predef/architecture/sparc.h +++ b/include/boost/predef/architecture/sparc.h @@ -48,8 +48,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_SPARC_NAME "SPARC" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_SPARC,BOOST_ARCH_SPARC_NAME) - - -#endif diff --git a/include/boost/predef/architecture/superh.h b/include/boost/predef/architecture/superh.h index ef88242..cc8be65 100644 --- a/include/boost/predef/architecture/superh.h +++ b/include/boost/predef/architecture/superh.h @@ -61,8 +61,7 @@ If available versions \[1-5\] are specifically detected. #define BOOST_ARCH_SH_NAME "SuperH" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_SH,BOOST_ARCH_SH_NAME) - - -#endif diff --git a/include/boost/predef/architecture/sys370.h b/include/boost/predef/architecture/sys370.h index 507ee86..a51470a 100644 --- a/include/boost/predef/architecture/sys370.h +++ b/include/boost/predef/architecture/sys370.h @@ -37,8 +37,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_SYS370_NAME "System/370" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_SYS370,BOOST_ARCH_SYS370_NAME) - - -#endif diff --git a/include/boost/predef/architecture/sys390.h b/include/boost/predef/architecture/sys390.h index 070117a..1b537f7 100644 --- a/include/boost/predef/architecture/sys390.h +++ b/include/boost/predef/architecture/sys390.h @@ -37,8 +37,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_SYS390_NAME "System/390" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_SYS390,BOOST_ARCH_SYS390_NAME) - - -#endif diff --git a/include/boost/predef/architecture/x86.h b/include/boost/predef/architecture/x86.h index fa9a025..3a8d645 100644 --- a/include/boost/predef/architecture/x86.h +++ b/include/boost/predef/architecture/x86.h @@ -5,12 +5,12 @@ Distributed under the Boost Software License, Version 1.0. http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_PREDEF_ARCHITECTURE_X86_H -#define BOOST_PREDEF_ARCHITECTURE_X86_H - #include #include +#ifndef BOOST_PREDEF_ARCHITECTURE_X86_H +#define BOOST_PREDEF_ARCHITECTURE_X86_H + /*` [heading `BOOST_ARCH_X86`] @@ -32,7 +32,7 @@ a category to indicate that either `BOOST_ARCH_X86_32` or #define BOOST_ARCH_X86_NAME "Intel x86" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_X86,BOOST_ARCH_X86_NAME) - -#endif diff --git a/include/boost/predef/architecture/x86/32.h b/include/boost/predef/architecture/x86/32.h index b796f84..5fa1bbe 100644 --- a/include/boost/predef/architecture/x86/32.h +++ b/include/boost/predef/architecture/x86/32.h @@ -79,9 +79,9 @@ If available versions \[3-6\] are specifically detected. #define BOOST_ARCH_X86_32_NAME "Intel x86-32" -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_X86_32,BOOST_ARCH_X86_32_NAME) - #include #endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_X86_32,BOOST_ARCH_X86_32_NAME) diff --git a/include/boost/predef/architecture/x86/64.h b/include/boost/predef/architecture/x86/64.h index a035c88..2524cdd 100644 --- a/include/boost/predef/architecture/x86/64.h +++ b/include/boost/predef/architecture/x86/64.h @@ -42,9 +42,9 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_X86_64_NAME "Intel x86-64" -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_X86_64,BOOST_ARCH_X86_64_NAME) - #include #endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_X86_64,BOOST_ARCH_X86_64_NAME) diff --git a/include/boost/predef/architecture/z.h b/include/boost/predef/architecture/z.h index 768f342..893c8c1 100644 --- a/include/boost/predef/architecture/z.h +++ b/include/boost/predef/architecture/z.h @@ -36,8 +36,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_ARCH_Z_NAME "z/Architecture" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_Z,BOOST_ARCH_Z_NAME) - - -#endif diff --git a/include/boost/predef/compiler.h b/include/boost/predef/compiler.h index 12c4dfc..61a4c52 100644 --- a/include/boost/predef/compiler.h +++ b/include/boost/predef/compiler.h @@ -1,12 +1,14 @@ /* -Copyright Rene Rivera 2008-2013 +Copyright Rene Rivera 2008-2015 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) */ +#if !defined(BOOST_PREDEF_COMPILER_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_COMPILER_H #define BOOST_PREDEF_COMPILER_H +#endif #include #include diff --git a/include/boost/predef/compiler/borland.h b/include/boost/predef/compiler/borland.h index 01b5de7..89ec27c 100644 --- a/include/boost/predef/compiler/borland.h +++ b/include/boost/predef/compiler/borland.h @@ -52,6 +52,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_BORLAND_NAME "Borland C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_BORLAND,BOOST_COMP_BORLAND_NAME) @@ -59,6 +61,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_BORLAND,BOOST_COMP_BORLAND_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_BORLAND_EMULATED,BOOST_COMP_BORLAND_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/clang.h b/include/boost/predef/compiler/clang.h index 87dd033..28689ce 100644 --- a/include/boost/predef/compiler/clang.h +++ b/include/boost/predef/compiler/clang.h @@ -45,6 +45,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_CLANG_NAME "Clang" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_CLANG,BOOST_COMP_CLANG_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_CLANG,BOOST_COMP_CLANG_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_CLANG_EMULATED,BOOST_COMP_CLANG_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/comeau.h b/include/boost/predef/compiler/comeau.h index 3862184..37c055b 100644 --- a/include/boost/predef/compiler/comeau.h +++ b/include/boost/predef/compiler/comeau.h @@ -50,6 +50,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_COMO_NAME "Comeau C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_COMO,BOOST_COMP_COMO_NAME) @@ -57,6 +59,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_COMO,BOOST_COMP_COMO_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_COMO_EMULATED,BOOST_COMP_COMO_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/compaq.h b/include/boost/predef/compiler/compaq.h index a922d17..c899cf4 100644 --- a/include/boost/predef/compiler/compaq.h +++ b/include/boost/predef/compiler/compaq.h @@ -55,6 +55,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_DEC_NAME "Compaq C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DEC,BOOST_COMP_DEC_NAME) @@ -62,6 +64,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DEC,BOOST_COMP_DEC_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DEC_EMULATED,BOOST_COMP_DEC_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/diab.h b/include/boost/predef/compiler/diab.h index 2cba03b..ecb8294 100644 --- a/include/boost/predef/compiler/diab.h +++ b/include/boost/predef/compiler/diab.h @@ -45,6 +45,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_DIAB_NAME "Diab C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DIAB,BOOST_COMP_DIAB_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DIAB,BOOST_COMP_DIAB_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DIAB_EMULATED,BOOST_COMP_DIAB_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/digitalmars.h b/include/boost/predef/compiler/digitalmars.h index 2306a7e..d816214 100644 --- a/include/boost/predef/compiler/digitalmars.h +++ b/include/boost/predef/compiler/digitalmars.h @@ -45,6 +45,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_DMC_NAME "Digital Mars" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DMC,BOOST_COMP_DMC_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DMC,BOOST_COMP_DMC_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_DMC_EMULATED,BOOST_COMP_DMC_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/dignus.h b/include/boost/predef/compiler/dignus.h index 33c3560..e02f9cc 100644 --- a/include/boost/predef/compiler/dignus.h +++ b/include/boost/predef/compiler/dignus.h @@ -45,6 +45,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_SYSC_NAME "Dignus Systems/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SYSC,BOOST_COMP_SYSC_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SYSC,BOOST_COMP_SYSC_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SYSC_EMULATED,BOOST_COMP_SYSC_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/edg.h b/include/boost/predef/compiler/edg.h index d53a5ff..b6baeef 100644 --- a/include/boost/predef/compiler/edg.h +++ b/include/boost/predef/compiler/edg.h @@ -45,6 +45,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_EDG_NAME "EDG C++ Frontend" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_EDG,BOOST_COMP_EDG_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_EDG,BOOST_COMP_EDG_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_EDG_EMULATED,BOOST_COMP_EDG_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/ekopath.h b/include/boost/predef/compiler/ekopath.h index 4d7dabe..4bebc60 100644 --- a/include/boost/predef/compiler/ekopath.h +++ b/include/boost/predef/compiler/ekopath.h @@ -46,6 +46,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_PATH_NAME "EKOpath" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PATH,BOOST_COMP_PATH_NAME) @@ -53,6 +55,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PATH,BOOST_COMP_PATH_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PATH_EMULATED,BOOST_COMP_PATH_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/gcc.h b/include/boost/predef/compiler/gcc.h index 5b226bd..53fb646 100644 --- a/include/boost/predef/compiler/gcc.h +++ b/include/boost/predef/compiler/gcc.h @@ -57,6 +57,8 @@ Version number available as major, minor, and patch (if available). #define BOOST_COMP_GNUC_NAME "Gnu GCC C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GNUC,BOOST_COMP_GNUC_NAME) @@ -64,6 +66,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GNUC,BOOST_COMP_GNUC_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GNUC_EMULATED,BOOST_COMP_GNUC_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/gcc_xml.h b/include/boost/predef/compiler/gcc_xml.h index ef55f5d..efbd1b1 100644 --- a/include/boost/predef/compiler/gcc_xml.h +++ b/include/boost/predef/compiler/gcc_xml.h @@ -42,6 +42,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_COMP_GCCXML_NAME "GCC XML" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GCCXML,BOOST_COMP_GCCXML_NAME) @@ -49,5 +51,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GCCXML,BOOST_COMP_GCCXML_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GCCXML_EMULATED,BOOST_COMP_GCCXML_NAME) #endif - -#endif diff --git a/include/boost/predef/compiler/greenhills.h b/include/boost/predef/compiler/greenhills.h index 462f57b..2f76ad7 100644 --- a/include/boost/predef/compiler/greenhills.h +++ b/include/boost/predef/compiler/greenhills.h @@ -55,6 +55,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_GHS_NAME "Green Hills C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GHS,BOOST_COMP_GHS_NAME) @@ -62,6 +64,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GHS,BOOST_COMP_GHS_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GHS_EMULATED,BOOST_COMP_GHS_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/hp_acc.h b/include/boost/predef/compiler/hp_acc.h index 8cb7022..a727739 100644 --- a/include/boost/predef/compiler/hp_acc.h +++ b/include/boost/predef/compiler/hp_acc.h @@ -50,6 +50,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_HPACC_NAME "HP aC++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_HPACC,BOOST_COMP_HPACC_NAME) @@ -57,6 +59,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_HPACC,BOOST_COMP_HPACC_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_HPACC_EMULATED,BOOST_COMP_HPACC_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/iar.h b/include/boost/predef/compiler/iar.h index dd6bc0e..04a056d 100644 --- a/include/boost/predef/compiler/iar.h +++ b/include/boost/predef/compiler/iar.h @@ -45,6 +45,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_IAR_NAME "IAR C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_IAR,BOOST_COMP_IAR_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_IAR,BOOST_COMP_IAR_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_IAR_EMULATED,BOOST_COMP_IAR_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/ibm.h b/include/boost/predef/compiler/ibm.h index 1edc93c..9a1ba02 100644 --- a/include/boost/predef/compiler/ibm.h +++ b/include/boost/predef/compiler/ibm.h @@ -61,6 +61,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_IBM_NAME "IBM XL C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_IBM,BOOST_COMP_IBM_NAME) @@ -68,6 +70,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_IBM,BOOST_COMP_IBM_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_IBM_EMULATED,BOOST_COMP_IBM_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/intel.h b/include/boost/predef/compiler/intel.h index 60220c7..9cee0a5 100644 --- a/include/boost/predef/compiler/intel.h +++ b/include/boost/predef/compiler/intel.h @@ -54,6 +54,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_INTEL_NAME "Intel C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_INTEL,BOOST_COMP_INTEL_NAME) @@ -61,6 +63,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_INTEL,BOOST_COMP_INTEL_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_INTEL_EMULATED,BOOST_COMP_INTEL_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/kai.h b/include/boost/predef/compiler/kai.h index 4aadbe3..c68a6fd 100644 --- a/include/boost/predef/compiler/kai.h +++ b/include/boost/predef/compiler/kai.h @@ -45,6 +45,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_KCC_NAME "Kai C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_KCC,BOOST_COMP_KCC_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_KCC,BOOST_COMP_KCC_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_KCC_EMULATED,BOOST_COMP_KCC_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/llvm.h b/include/boost/predef/compiler/llvm.h index c7e634c..340b3c7 100644 --- a/include/boost/predef/compiler/llvm.h +++ b/include/boost/predef/compiler/llvm.h @@ -46,6 +46,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_COMP_LLVM_NAME "LLVM" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_LLVM,BOOST_COMP_LLVM_NAME) @@ -53,6 +55,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_LLVM,BOOST_COMP_LLVM_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_LLVM_EMULATED,BOOST_COMP_LLVM_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/metaware.h b/include/boost/predef/compiler/metaware.h index 5e13de8..7bbc22c 100644 --- a/include/boost/predef/compiler/metaware.h +++ b/include/boost/predef/compiler/metaware.h @@ -42,6 +42,8 @@ MetaWare High C/C++ compiler. #define BOOST_COMP_HIGHC_NAME "MetaWare High C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_HIGHC,BOOST_COMP_HIGHC_NAME) @@ -49,6 +51,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_HIGHC,BOOST_COMP_HIGHC_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_HIGHC_EMULATED,BOOST_COMP_HIGHC_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/metrowerks.h b/include/boost/predef/compiler/metrowerks.h index 409282b..d6bd68b 100644 --- a/include/boost/predef/compiler/metrowerks.h +++ b/include/boost/predef/compiler/metrowerks.h @@ -66,6 +66,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_MWERKS_NAME "Metrowerks CodeWarrior" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MWERKS,BOOST_COMP_MWERKS_NAME) @@ -73,6 +75,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MWERKS,BOOST_COMP_MWERKS_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MWERKS_EMULATED,BOOST_COMP_MWERKS_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/microtec.h b/include/boost/predef/compiler/microtec.h index 6bd6279..a311e35 100644 --- a/include/boost/predef/compiler/microtec.h +++ b/include/boost/predef/compiler/microtec.h @@ -42,6 +42,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_COMP_MRI_NAME "Microtec C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MRI,BOOST_COMP_MRI_NAME) @@ -49,6 +51,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MRI,BOOST_COMP_MRI_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MRI_EMULATED,BOOST_COMP_MRI_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/mpw.h b/include/boost/predef/compiler/mpw.h index 3a48f6f..aa982b8 100644 --- a/include/boost/predef/compiler/mpw.h +++ b/include/boost/predef/compiler/mpw.h @@ -52,6 +52,8 @@ Version number available as major, and minor. #define BOOST_COMP_MPW_NAME "MPW C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MPW,BOOST_COMP_MPW_NAME) @@ -59,6 +61,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MPW,BOOST_COMP_MPW_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MPW_EMULATED,BOOST_COMP_MPW_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/palm.h b/include/boost/predef/compiler/palm.h index eb1da97..5998d86 100644 --- a/include/boost/predef/compiler/palm.h +++ b/include/boost/predef/compiler/palm.h @@ -45,6 +45,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_PALM_NAME "Palm C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PALM,BOOST_COMP_PALM_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PALM,BOOST_COMP_PALM_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PALM_EMULATED,BOOST_COMP_PALM_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/pgi.h b/include/boost/predef/compiler/pgi.h index 563335f..df304f7 100644 --- a/include/boost/predef/compiler/pgi.h +++ b/include/boost/predef/compiler/pgi.h @@ -49,6 +49,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_COMP_PGI_NAME "Portland Group C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PGI,BOOST_COMP_PGI_NAME) @@ -56,6 +58,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PGI,BOOST_COMP_PGI_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_PGI_EMULATED,BOOST_COMP_PGI_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/sgi_mipspro.h b/include/boost/predef/compiler/sgi_mipspro.h index c212b19..9f44dd4 100644 --- a/include/boost/predef/compiler/sgi_mipspro.h +++ b/include/boost/predef/compiler/sgi_mipspro.h @@ -55,6 +55,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_SGI_NAME "SGI MIPSpro" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SGI,BOOST_COMP_SGI_NAME) @@ -62,6 +64,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SGI,BOOST_COMP_SGI_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SGI_EMULATED,BOOST_COMP_SGI_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/sunpro.h b/include/boost/predef/compiler/sunpro.h index 79f3128..43498e2 100644 --- a/include/boost/predef/compiler/sunpro.h +++ b/include/boost/predef/compiler/sunpro.h @@ -65,6 +65,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_SUNPRO_NAME "Oracle Solaris Studio" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SUNPRO,BOOST_COMP_SUNPRO_NAME) @@ -72,6 +74,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SUNPRO,BOOST_COMP_SUNPRO_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_SUNPRO_EMULATED,BOOST_COMP_SUNPRO_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/tendra.h b/include/boost/predef/compiler/tendra.h index 194f0af..38f8da5 100644 --- a/include/boost/predef/compiler/tendra.h +++ b/include/boost/predef/compiler/tendra.h @@ -42,6 +42,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_COMP_TENDRA_NAME "TenDRA C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_TENDRA,BOOST_COMP_TENDRA_NAME) @@ -49,6 +51,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_TENDRA,BOOST_COMP_TENDRA_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_TENDRA_EMULATED,BOOST_COMP_TENDRA_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/visualc.h b/include/boost/predef/compiler/visualc.h index 959d38f..5e6f81e 100644 --- a/include/boost/predef/compiler/visualc.h +++ b/include/boost/predef/compiler/visualc.h @@ -80,6 +80,8 @@ Version number available as major, minor, and patch. #define BOOST_COMP_MSVC_NAME "Microsoft Visual C/C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MSVC,BOOST_COMP_MSVC_NAME) @@ -87,6 +89,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MSVC,BOOST_COMP_MSVC_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MSVC_EMULATED,BOOST_COMP_MSVC_NAME) #endif - - -#endif diff --git a/include/boost/predef/compiler/watcom.h b/include/boost/predef/compiler/watcom.h index 832d10c..958fae8 100644 --- a/include/boost/predef/compiler/watcom.h +++ b/include/boost/predef/compiler/watcom.h @@ -45,6 +45,8 @@ Version number available as major, and minor. #define BOOST_COMP_WATCOM_NAME "Watcom C++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_WATCOM,BOOST_COMP_WATCOM_NAME) @@ -52,6 +54,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_WATCOM,BOOST_COMP_WATCOM_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_WATCOM_EMULATED,BOOST_COMP_WATCOM_NAME) #endif - - -#endif diff --git a/include/boost/predef/detail/test_def.h b/include/boost/predef/detail/test_def.h new file mode 100644 index 0000000..c2f195b --- /dev/null +++ b/include/boost/predef/detail/test_def.h @@ -0,0 +1,71 @@ +/* +Copyright Rene Rivera 2011-2015 +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 + +#define BOOST_PREDEF_INTERNAL_GENERATE_TESTS + +void * add_predef_entry(const char * name, const char * description, unsigned value); +#undef BOOST_PREDEF_DECLARE_TEST +#define BOOST_PREDEF_DECLARE_TEST(x,s) void predef_entry_##x() { add_predef_entry(#x, s, x); } +#include + +#undef BOOST_PREDEF_DECLARE_TEST +#define BOOST_PREDEF_DECLARE_TEST(x,s) predef_entry_##x(); +void create_predef_entries() +{ +#include +} + +#ifdef __cplusplus +#include +#include +#include +using namespace std; +#else +#include +#include +#include +#endif + +typedef struct predef_info +{ + const char * name; + const char * description; + unsigned value; +} predef_info; + +#ifdef __cplusplus +using namespace std; +#endif + +unsigned generated_predef_info_count = 0; +predef_info* generated_predef_info = 0; +void * add_predef_entry(const char * name, const char * description, unsigned value) +{ + if (0 == generated_predef_info_count) + { + generated_predef_info_count = 1; + generated_predef_info = (predef_info*)malloc(sizeof(predef_info)); + } + else + { + generated_predef_info_count += 1; + generated_predef_info = (predef_info*)realloc(generated_predef_info, + generated_predef_info_count*sizeof(predef_info)); + } + generated_predef_info[generated_predef_info_count-1].name = name; + generated_predef_info[generated_predef_info_count-1].description = description; + generated_predef_info[generated_predef_info_count-1].value = value; + return 0; +} + +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); +} diff --git a/include/boost/predef/language.h b/include/boost/predef/language.h index c9251c5..0a317d5 100644 --- a/include/boost/predef/language.h +++ b/include/boost/predef/language.h @@ -1,12 +1,14 @@ /* -Copyright Rene Rivera 2011-2012 +Copyright Rene Rivera 2011-2015 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) */ +#if !defined(BOOST_PREDEF_LANGUAGE_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_LANGUAGE_H #define BOOST_PREDEF_LANGUAGE_H +#endif #include #include diff --git a/include/boost/predef/language/objc.h b/include/boost/predef/language/objc.h index 27a32b6..ce2f2ed 100644 --- a/include/boost/predef/language/objc.h +++ b/include/boost/predef/language/objc.h @@ -36,8 +36,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LANG_OBJC_NAME "Objective-C" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_OBJC,BOOST_LANG_OBJC_NAME) - - -#endif diff --git a/include/boost/predef/language/stdc.h b/include/boost/predef/language/stdc.h index 59a4e0b..2df24a6 100644 --- a/include/boost/predef/language/stdc.h +++ b/include/boost/predef/language/stdc.h @@ -47,8 +47,7 @@ If available, the year of the standard is detected as YYYY.MM.1 from the Epoc da #define BOOST_LANG_STDC_NAME "Standard C" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDC,BOOST_LANG_STDC_NAME) - - -#endif diff --git a/include/boost/predef/language/stdcpp.h b/include/boost/predef/language/stdcpp.h index 693c67b..e8ee722 100644 --- a/include/boost/predef/language/stdcpp.h +++ b/include/boost/predef/language/stdcpp.h @@ -52,10 +52,6 @@ Specifically the defined versions are: #define BOOST_LANG_STDCPP_NAME "Standard C++" -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPP,BOOST_LANG_STDCPP_NAME) - - /*` [heading `BOOST_LANG_STDCPPCLI`] @@ -88,10 +84,6 @@ If available, the year of the standard is detected as YYYY.MM.1 from the Epoc da #define BOOST_LANG_STDCPPCLI_NAME "Standard C++/CLI" -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPPCLI,BOOST_LANG_STDCPPCLI_NAME) - - /*` [heading `BOOST_LANG_STDECPP`] @@ -117,8 +109,13 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPPCLI,BOOST_LANG_STDCPPCLI_NAME) #define BOOST_LANG_STDECPP_NAME "Standard Embedded C++" +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPP,BOOST_LANG_STDCPP_NAME) + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPPCLI,BOOST_LANG_STDCPPCLI_NAME) + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDECPP,BOOST_LANG_STDECPP_NAME) - - -#endif diff --git a/include/boost/predef/library.h b/include/boost/predef/library.h index a474323..40518a9 100644 --- a/include/boost/predef/library.h +++ b/include/boost/predef/library.h @@ -1,12 +1,14 @@ /* -Copyright Rene Rivera 2008-2012 +Copyright Rene Rivera 2008-2015 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) */ +#if !defined(BOOST_PREDEF_LIBRARY_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_LIBRARY_H #define BOOST_PREDEF_LIBRARY_H +#endif #include #include diff --git a/include/boost/predef/library/c.h b/include/boost/predef/library/c.h index 733e6a7..fa8841e 100644 --- a/include/boost/predef/library/c.h +++ b/include/boost/predef/library/c.h @@ -1,12 +1,14 @@ /* -Copyright Rene Rivera 2008-2012 +Copyright Rene Rivera 2008-2015 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) */ +#if !defined(BOOST_PREDEF_LIBRARY_C_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_LIBRARY_C_H #define BOOST_PREDEF_LIBRARY_C_H +#endif #include diff --git a/include/boost/predef/library/c/gnu.h b/include/boost/predef/library/c/gnu.h index 8ed9f76..223ae43 100644 --- a/include/boost/predef/library/c/gnu.h +++ b/include/boost/predef/library/c/gnu.h @@ -55,8 +55,7 @@ Version number available as major, and minor. #define BOOST_LIB_C_GNU_NAME "GNU" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_GNU,BOOST_LIB_C_GNU_NAME) - - -#endif diff --git a/include/boost/predef/library/c/uc.h b/include/boost/predef/library/c/uc.h index 8b47de1..8e4e505 100644 --- a/include/boost/predef/library/c/uc.h +++ b/include/boost/predef/library/c/uc.h @@ -41,8 +41,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LIB_C_UC_NAME "uClibc" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_UC,BOOST_LIB_C_UC_NAME) - - -#endif diff --git a/include/boost/predef/library/c/vms.h b/include/boost/predef/library/c/vms.h index 0357d05..d5d8139 100644 --- a/include/boost/predef/library/c/vms.h +++ b/include/boost/predef/library/c/vms.h @@ -41,8 +41,7 @@ Version number available as major, minor, and patch. #define BOOST_LIB_C_VMS_NAME "VMS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_VMS,BOOST_LIB_C_VMS_NAME) - - -#endif diff --git a/include/boost/predef/library/c/zos.h b/include/boost/predef/library/c/zos.h index 4c6f058..dfadaa1 100644 --- a/include/boost/predef/library/c/zos.h +++ b/include/boost/predef/library/c/zos.h @@ -50,8 +50,7 @@ Version number available as major, minor, and patch. #define BOOST_LIB_C_ZOS_NAME "z/OS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_ZOS,BOOST_LIB_C_ZOS_NAME) - - -#endif diff --git a/include/boost/predef/library/std.h b/include/boost/predef/library/std.h index 9ab0a86..403b6ff 100644 --- a/include/boost/predef/library/std.h +++ b/include/boost/predef/library/std.h @@ -1,11 +1,13 @@ /* -Copyright Rene Rivera 2008-2013 +Copyright Rene Rivera 2008-2015 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) */ +#if !defined(BOOST_PREDEF_LIBRARY_STD_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_LIBRARY_STD_H #define BOOST_PREDEF_LIBRARY_STD_H +#endif #include diff --git a/include/boost/predef/library/std/cxx.h b/include/boost/predef/library/std/cxx.h index 1d0cf5f..658a997 100644 --- a/include/boost/predef/library/std/cxx.h +++ b/include/boost/predef/library/std/cxx.h @@ -40,8 +40,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LIB_STD_CXX_NAME "libc++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_CXX,BOOST_LIB_STD_CXX_NAME) - - -#endif diff --git a/include/boost/predef/library/std/dinkumware.h b/include/boost/predef/library/std/dinkumware.h index 394e866..83f759d 100644 --- a/include/boost/predef/library/std/dinkumware.h +++ b/include/boost/predef/library/std/dinkumware.h @@ -46,8 +46,7 @@ If available version number as major, minor, and patch. #define BOOST_LIB_STD_DINKUMWARE_NAME "Dinkumware" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_DINKUMWARE,BOOST_LIB_STD_DINKUMWARE_NAME) - - -#endif diff --git a/include/boost/predef/library/std/libcomo.h b/include/boost/predef/library/std/libcomo.h index 41bbe67..6b8ebaa 100644 --- a/include/boost/predef/library/std/libcomo.h +++ b/include/boost/predef/library/std/libcomo.h @@ -41,8 +41,7 @@ Version number available as major. #define BOOST_LIB_STD_COMO_NAME "Comeau Computing" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_COMO,BOOST_LIB_STD_COMO_NAME) - - -#endif diff --git a/include/boost/predef/library/std/modena.h b/include/boost/predef/library/std/modena.h index fa7c061..1ec0022 100644 --- a/include/boost/predef/library/std/modena.h +++ b/include/boost/predef/library/std/modena.h @@ -39,8 +39,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LIB_STD_MSIPL_NAME "Modena Software Lib++" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_MSIPL,BOOST_LIB_STD_MSIPL_NAME) - - -#endif diff --git a/include/boost/predef/library/std/msl.h b/include/boost/predef/library/std/msl.h index 16ddec6..94a5ac6 100644 --- a/include/boost/predef/library/std/msl.h +++ b/include/boost/predef/library/std/msl.h @@ -47,8 +47,7 @@ Version number available as major, minor, and patch. #define BOOST_LIB_STD_MSL_NAME "Metrowerks" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_MSL,BOOST_LIB_STD_MSL_NAME) - - -#endif diff --git a/include/boost/predef/library/std/roguewave.h b/include/boost/predef/library/std/roguewave.h index 38471d0..dcea39f 100644 --- a/include/boost/predef/library/std/roguewave.h +++ b/include/boost/predef/library/std/roguewave.h @@ -50,8 +50,7 @@ If available version number as major, minor, and patch. #define BOOST_LIB_STD_RW_NAME "Roguewave" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_RW,BOOST_LIB_STD_RW_NAME) - - -#endif diff --git a/include/boost/predef/library/std/sgi.h b/include/boost/predef/library/std/sgi.h index 16f0db1..96e6a33 100644 --- a/include/boost/predef/library/std/sgi.h +++ b/include/boost/predef/library/std/sgi.h @@ -45,8 +45,7 @@ If available version number as major, minor, and patch. #define BOOST_LIB_STD_SGI_NAME "SGI" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_SGI,BOOST_LIB_STD_SGI_NAME) - - -#endif diff --git a/include/boost/predef/library/std/stdcpp3.h b/include/boost/predef/library/std/stdcpp3.h index 19ebc86..255bdbc 100644 --- a/include/boost/predef/library/std/stdcpp3.h +++ b/include/boost/predef/library/std/stdcpp3.h @@ -47,8 +47,7 @@ Version number available as year (from 1970), month, and day. #define BOOST_LIB_STD_GNU_NAME "GNU" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_GNU,BOOST_LIB_STD_GNU_NAME) - - -#endif diff --git a/include/boost/predef/library/std/stlport.h b/include/boost/predef/library/std/stlport.h index 1b6cebb..8c89882 100644 --- a/include/boost/predef/library/std/stlport.h +++ b/include/boost/predef/library/std/stlport.h @@ -53,8 +53,7 @@ Version number available as major, minor, and patch. #define BOOST_LIB_STD_STLPORT_NAME "STLport" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_STLPORT,BOOST_LIB_STD_STLPORT_NAME) - - -#endif diff --git a/include/boost/predef/library/std/vacpp.h b/include/boost/predef/library/std/vacpp.h index 1c259c5..d7102d1 100644 --- a/include/boost/predef/library/std/vacpp.h +++ b/include/boost/predef/library/std/vacpp.h @@ -38,8 +38,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_LIB_STD_IBM_NAME "IBM VACPP" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_STD_IBM,BOOST_LIB_STD_IBM_NAME) - - -#endif diff --git a/include/boost/predef/os.h b/include/boost/predef/os.h index abd6666..bedf99e 100644 --- a/include/boost/predef/os.h +++ b/include/boost/predef/os.h @@ -1,13 +1,15 @@ /* -Copyright Rene Rivera 2008-2012 +Copyright Rene Rivera 2008-2015 Copyright Franz Detro 2014 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) */ +#if !defined(BOOST_PREDEF_OS_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_OS_H #define BOOST_PREDEF_OS_H +#endif #include #include diff --git a/include/boost/predef/os/aix.h b/include/boost/predef/os/aix.h index 07523c8..308e35d 100644 --- a/include/boost/predef/os/aix.h +++ b/include/boost/predef/os/aix.h @@ -60,8 +60,7 @@ Version number available as major, minor, and patch. #define BOOST_OS_AIX_NAME "IBM AIX" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_AIX,BOOST_OS_AIX_NAME) - - -#endif diff --git a/include/boost/predef/os/amigaos.h b/include/boost/predef/os/amigaos.h index fae2408..11fe19f 100644 --- a/include/boost/predef/os/amigaos.h +++ b/include/boost/predef/os/amigaos.h @@ -40,8 +40,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_AMIGAOS_NAME "AmigaOS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_AMIGAOS,BOOST_OS_AMIGAOS_NAME) - - -#endif diff --git a/include/boost/predef/os/android.h b/include/boost/predef/os/android.h index 0de5870..c0d8119 100644 --- a/include/boost/predef/os/android.h +++ b/include/boost/predef/os/android.h @@ -39,8 +39,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_ANDROID_NAME "Android" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_ANDROID,BOOST_OS_ANDROID_NAME) - - -#endif diff --git a/include/boost/predef/os/beos.h b/include/boost/predef/os/beos.h index 7a92b94..8a8bc4b 100644 --- a/include/boost/predef/os/beos.h +++ b/include/boost/predef/os/beos.h @@ -39,8 +39,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_BEOS_NAME "BeOS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BEOS,BOOST_OS_BEOS_NAME) - - -#endif diff --git a/include/boost/predef/os/bsd.h b/include/boost/predef/os/bsd.h index f370f56..226eb3e 100644 --- a/include/boost/predef/os/bsd.h +++ b/include/boost/predef/os/bsd.h @@ -89,7 +89,15 @@ of BSD. If the above variants is detected the corresponding macro is also set.] #define BOOST_OS_BSD_NAME "BSD" -#include -BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,BOOST_OS_BSD_NAME) +#else + +#include +#include +#include +#include +#include #endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,BOOST_OS_BSD_NAME) diff --git a/include/boost/predef/os/bsd/bsdi.h b/include/boost/predef/os/bsd/bsdi.h index cb57e1b..e2f738a 100644 --- a/include/boost/predef/os/bsd/bsdi.h +++ b/include/boost/predef/os/bsd/bsdi.h @@ -42,7 +42,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_BSD_BSDI_NAME "BSDi BSD/OS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_BSDI,BOOST_OS_BSD_BSDI_NAME) - -#endif diff --git a/include/boost/predef/os/bsd/dragonfly.h b/include/boost/predef/os/bsd/dragonfly.h index 202f8a1..aacda9a 100644 --- a/include/boost/predef/os/bsd/dragonfly.h +++ b/include/boost/predef/os/bsd/dragonfly.h @@ -44,7 +44,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_BSD_DRAGONFLY_NAME "DragonFly BSD" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_DRAGONFLY,BOOST_OS_BSD_DRAGONFLY_NAME) - -#endif diff --git a/include/boost/predef/os/bsd/free.h b/include/boost/predef/os/bsd/free.h index 404e8ed..cfdfc97 100644 --- a/include/boost/predef/os/bsd/free.h +++ b/include/boost/predef/os/bsd/free.h @@ -54,7 +54,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_BSD_FREE_NAME "Free BSD" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_FREE,BOOST_OS_BSD_FREE_NAME) - -#endif diff --git a/include/boost/predef/os/bsd/net.h b/include/boost/predef/os/bsd/net.h index dcc4131..5e38bf0 100644 --- a/include/boost/predef/os/bsd/net.h +++ b/include/boost/predef/os/bsd/net.h @@ -78,7 +78,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_BSD_NET_NAME "DragonFly BSD" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_NET,BOOST_OS_BSD_NET_NAME) - -#endif diff --git a/include/boost/predef/os/bsd/open.h b/include/boost/predef/os/bsd/open.h index e81ebc6..5ed6c8f 100644 --- a/include/boost/predef/os/bsd/open.h +++ b/include/boost/predef/os/bsd/open.h @@ -165,7 +165,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_BSD_OPEN_NAME "OpenBSD" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_OPEN,BOOST_OS_BSD_OPEN_NAME) - -#endif diff --git a/include/boost/predef/os/cygwin.h b/include/boost/predef/os/cygwin.h index 04ee399..9b1d5d7 100644 --- a/include/boost/predef/os/cygwin.h +++ b/include/boost/predef/os/cygwin.h @@ -39,8 +39,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_CYGWIN_NAME "Cygwin" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_CYGWIN,BOOST_OS_CYGWIN_NAME) - - -#endif diff --git a/include/boost/predef/os/haiku.h b/include/boost/predef/os/haiku.h index 4d741cf..17ed382 100644 --- a/include/boost/predef/os/haiku.h +++ b/include/boost/predef/os/haiku.h @@ -40,8 +40,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_HAIKU_NAME "Haiku" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_HAIKU,BOOST_OS_HAIKU_NAME) - - -#endif diff --git a/include/boost/predef/os/hpux.h b/include/boost/predef/os/hpux.h index 946196f..b4da30d 100644 --- a/include/boost/predef/os/hpux.h +++ b/include/boost/predef/os/hpux.h @@ -41,8 +41,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_HPUX_NAME "HP-UX" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_HPUX,BOOST_OS_HPUX_NAME) - - -#endif diff --git a/include/boost/predef/os/ios.h b/include/boost/predef/os/ios.h index b83a9db..d07513d 100644 --- a/include/boost/predef/os/ios.h +++ b/include/boost/predef/os/ios.h @@ -44,8 +44,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_IOS_NAME "iOS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IOS,BOOST_OS_IOS_NAME) - - -#endif diff --git a/include/boost/predef/os/irix.h b/include/boost/predef/os/irix.h index a9e63b8..35cf0b3 100644 --- a/include/boost/predef/os/irix.h +++ b/include/boost/predef/os/irix.h @@ -40,8 +40,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_IRIX_NAME "IRIX" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IRIX,BOOST_OS_IRIX_NAME) - - -#endif diff --git a/include/boost/predef/os/linux.h b/include/boost/predef/os/linux.h index b436e3f..ed47b9b 100644 --- a/include/boost/predef/os/linux.h +++ b/include/boost/predef/os/linux.h @@ -40,8 +40,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_LINUX_NAME "Linux" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_LINUX,BOOST_OS_LINUX_NAME) - - -#endif diff --git a/include/boost/predef/os/macos.h b/include/boost/predef/os/macos.h index cdcf2cb..a686ce4 100644 --- a/include/boost/predef/os/macos.h +++ b/include/boost/predef/os/macos.h @@ -59,8 +59,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_MACOS_NAME "Mac OS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_MACOS,BOOST_OS_MACOS_NAME) - - -#endif diff --git a/include/boost/predef/os/os400.h b/include/boost/predef/os/os400.h index f7aacf5..b26e56c 100644 --- a/include/boost/predef/os/os400.h +++ b/include/boost/predef/os/os400.h @@ -39,8 +39,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_OS400_NAME "IBM OS/400" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_OS400,BOOST_OS_OS400_NAME) - - -#endif diff --git a/include/boost/predef/os/qnxnto.h b/include/boost/predef/os/qnxnto.h index dff536f..7d444f7 100644 --- a/include/boost/predef/os/qnxnto.h +++ b/include/boost/predef/os/qnxnto.h @@ -53,8 +53,7 @@ version 4 is specifically detected. #define BOOST_OS_QNX_NAME "QNX" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_QNX,BOOST_OS_QNX_NAME) - - -#endif diff --git a/include/boost/predef/os/solaris.h b/include/boost/predef/os/solaris.h index 4d47dfe..7e71c31 100644 --- a/include/boost/predef/os/solaris.h +++ b/include/boost/predef/os/solaris.h @@ -40,8 +40,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_SOLARIS_NAME "Solaris" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_SOLARIS,BOOST_OS_SOLARIS_NAME) - - -#endif diff --git a/include/boost/predef/os/unix.h b/include/boost/predef/os/unix.h index 3636dda..38b4652 100644 --- a/include/boost/predef/os/unix.h +++ b/include/boost/predef/os/unix.h @@ -69,8 +69,8 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_SVR4_NAME "SVR4 Environment" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_UNIX,BOOST_OS_UNIX_NAME) BOOST_PREDEF_DECLARE_TEST(BOOST_OS_SVR4,BOOST_OS_SVR4_NAME) - -#endif diff --git a/include/boost/predef/os/vms.h b/include/boost/predef/os/vms.h index 3d34f63..13cde57 100644 --- a/include/boost/predef/os/vms.h +++ b/include/boost/predef/os/vms.h @@ -46,8 +46,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_VMS_NAME "VMS" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_VMS,BOOST_OS_VMS_NAME) - - -#endif diff --git a/include/boost/predef/os/windows.h b/include/boost/predef/os/windows.h index 9072539..2dd94be 100644 --- a/include/boost/predef/os/windows.h +++ b/include/boost/predef/os/windows.h @@ -45,7 +45,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_OS_WINDOWS_NAME "Microsoft Windows" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_OS_WINDOWS,BOOST_OS_WINDOWS_NAME) - -#endif diff --git a/include/boost/predef/other.h b/include/boost/predef/other.h index 04aad16..c09ad49 100644 --- a/include/boost/predef/other.h +++ b/include/boost/predef/other.h @@ -1,12 +1,14 @@ /* -Copyright Rene Rivera 2013 +Copyright Rene Rivera 2013-2015 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) */ +#if !defined(BOOST_PREDEF_OTHER_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_OTHER_H #define BOOST_PREDEF_OTHER_H +#endif #include /*#include */ diff --git a/include/boost/predef/other/endian.h b/include/boost/predef/other/endian.h index 048cc5d..d1d9ff1 100644 --- a/include/boost/predef/other/endian.h +++ b/include/boost/predef/other/endian.h @@ -189,6 +189,8 @@ information and acquired knowledge: #define BOOST_ENDIAN_LITTLE_BYTE_NAME "Byte-Swapped Little-Endian" #define BOOST_ENDIAN_LITTLE_WORD_NAME "Word-Swapped Little-Endian" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_BIG_BYTE,BOOST_ENDIAN_BIG_BYTE_NAME) @@ -200,6 +202,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_LITTLE_BYTE,BOOST_ENDIAN_LITTLE_BYTE_NAME #include BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_LITTLE_WORD,BOOST_ENDIAN_LITTLE_WORD_NAME) - - -#endif diff --git a/include/boost/predef/platform.h b/include/boost/predef/platform.h index 468a90d..c0c8706 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -1,13 +1,15 @@ /* -Copyright Rene Rivera 2013 +Copyright Rene Rivera 2013-2015 Copyright (c) Microsoft Corporation 2014 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) */ +#if !defined(BOOST_PREDEF_PLATFORM_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) #ifndef BOOST_PREDEF_PLATFORM_H #define BOOST_PREDEF_PLATFORM_H +#endif #include #include diff --git a/include/boost/predef/platform/mingw.h b/include/boost/predef/platform/mingw.h index 6c8d873..d7f8e3f 100644 --- a/include/boost/predef/platform/mingw.h +++ b/include/boost/predef/platform/mingw.h @@ -58,6 +58,8 @@ Version number available as major, minor, and patch. #define BOOST_PLAT_MINGW_NAME "MinGW" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW,BOOST_PLAT_MINGW_NAME) @@ -65,6 +67,3 @@ BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW,BOOST_PLAT_MINGW_NAME) #include BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW_EMULATED,BOOST_PLAT_MINGW_NAME) #endif - - -#endif diff --git a/include/boost/predef/platform/windows_desktop.h b/include/boost/predef/platform/windows_desktop.h index 286c273..7bb847e 100644 --- a/include/boost/predef/platform/windows_desktop.h +++ b/include/boost/predef/platform/windows_desktop.h @@ -38,7 +38,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PLAT_WINDOWS_DESKTOP_NAME "Windows Desktop" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_DESKTOP,BOOST_PLAT_WINDOWS_DESKTOP_NAME) - -#endif diff --git a/include/boost/predef/platform/windows_phone.h b/include/boost/predef/platform/windows_phone.h index cdf79d1..be488af 100644 --- a/include/boost/predef/platform/windows_phone.h +++ b/include/boost/predef/platform/windows_phone.h @@ -36,7 +36,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PLAT_WINDOWS_PHONE_NAME "Windows Phone" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_PHONE,BOOST_PLAT_WINDOWS_PHONE_NAME) - -#endif diff --git a/include/boost/predef/platform/windows_runtime.h b/include/boost/predef/platform/windows_runtime.h index 1444938..5c4da63 100644 --- a/include/boost/predef/platform/windows_runtime.h +++ b/include/boost/predef/platform/windows_runtime.h @@ -38,7 +38,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PLAT_WINDOWS_RUNTIME_NAME "Windows Runtime" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_RUNTIME,BOOST_PLAT_WINDOWS_RUNTIME_NAME) - -#endif diff --git a/include/boost/predef/platform/windows_store.h b/include/boost/predef/platform/windows_store.h index 0487c0f..9330f5d 100644 --- a/include/boost/predef/platform/windows_store.h +++ b/include/boost/predef/platform/windows_store.h @@ -36,7 +36,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PLAT_WINDOWS_STORE_NAME "Windows Store" +#endif + #include BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_STORE,BOOST_PLAT_WINDOWS_STORE_NAME) - -#endif diff --git a/test/info_as_c.c b/test/info_as_c.c index ba84947..44f7e8d 100644 --- a/test/info_as_c.c +++ b/test/info_as_c.c @@ -1,76 +1,7 @@ /* -Copyright Rene Rivera 2011-2012 +Copyright Rene Rivera 2011-2015 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; - const char * name; - const 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() -{ - unsigned x = 0; - 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 = (predef_info**)realloc(predefs,predef_count*sizeof(predef_info*)); - predefs[predef_count-1] = (predef_info*)i; - } - } - qsort(predefs,predef_count,sizeof(predef_info*),predef_info_compare); - 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; -} +#include "predef_info.h" diff --git a/test/info_as_cpp.cpp b/test/info_as_cpp.cpp index e484312..44f7e8d 100644 --- a/test/info_as_cpp.cpp +++ b/test/info_as_cpp.cpp @@ -1,90 +1,7 @@ /* -Copyright Rene Rivera 2011-2012 +Copyright Rene Rivera 2011-2015 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; -} +#include "predef_info.h" diff --git a/test/info_as_objc.m b/test/info_as_objc.m index 79dc80f..44f7e8d 100644 --- a/test/info_as_objc.m +++ b/test/info_as_objc.m @@ -1,7 +1,7 @@ /* -Copyright Rene Rivera 2011 +Copyright Rene Rivera 2011-2015 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" +#include "predef_info.h" diff --git a/test/info_as_objcpp.mm b/test/info_as_objcpp.mm index 5d8c92a..44f7e8d 100644 --- a/test/info_as_objcpp.mm +++ b/test/info_as_objcpp.mm @@ -1,7 +1,7 @@ /* -Copyright Rene Rivera 2011 +Copyright Rene Rivera 2011-2015 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" +#include "predef_info.h" diff --git a/test/predef_info.h b/test/predef_info.h new file mode 100644 index 0000000..2adb638 --- /dev/null +++ b/test/predef_info.h @@ -0,0 +1,46 @@ +/* +Copyright Rene Rivera 2011-2015 +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 + +int main(int argc, const char ** argv) +{ + unsigned x = 0; + create_predef_entries(); + qsort(generated_predef_info,generated_predef_info_count, + sizeof(predef_info),predef_info_compare); + /* + for (x = 0; x < generated_predef_info_count; ++x) + { + printf("%s: %d\n", generated_predef_info[x].name, generated_predef_info[x].value); + } + */ + puts("** Detected **"); + for (x = 0; x < generated_predef_info_count; ++x) + { + if (generated_predef_info[x].value > 0) + printf("%s = %u (%u,%u,%u) | %s\n", + generated_predef_info[x].name, + generated_predef_info[x].value, + (generated_predef_info[x].value/10000000)%100, + (generated_predef_info[x].value/100000)%100, + (generated_predef_info[x].value)%100000, + generated_predef_info[x].description); + } + puts("** Not Detected **"); + for (x = 0; x < generated_predef_info_count; ++x) + { + if (generated_predef_info[x].value == 0) + printf("%s = %u | %s\n", + generated_predef_info[x].name, + generated_predef_info[x].value, + generated_predef_info[x].description); + } + if (generated_predef_info_count > 0) + return 0; + else + return 1; +}