From 6f8a9ae4409cbf7ab0fa7f204072ce9bfe348fa7 Mon Sep 17 00:00:00 2001 From: "James E. King, III" Date: Mon, 23 Oct 2017 14:54:01 -0400 Subject: [PATCH] platform detection for CloudABI with cloudlibc detection (#65) --- include/boost/predef/library/c.h | 1 + include/boost/predef/library/c/cloudlibc.h | 53 ++++++++++++++++++++++ include/boost/predef/platform.h | 1 + include/boost/predef/platform/cloudabi.h | 43 ++++++++++++++++++ 4 files changed, 98 insertions(+) create mode 100644 include/boost/predef/library/c/cloudlibc.h create mode 100644 include/boost/predef/platform/cloudabi.h diff --git a/include/boost/predef/library/c.h b/include/boost/predef/library/c.h index fa8841e..eb9b73c 100644 --- a/include/boost/predef/library/c.h +++ b/include/boost/predef/library/c.h @@ -12,6 +12,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include #include diff --git a/include/boost/predef/library/c/cloudlibc.h b/include/boost/predef/library/c/cloudlibc.h new file mode 100644 index 0000000..6db32b8 --- /dev/null +++ b/include/boost/predef/library/c/cloudlibc.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2017 James E. King, III + * + * 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_LIBRARY_C_CLOUDLIBC_H +#define BOOST_PREDEF_LIBRARY_C_CLOUDLIBC_H + +#include +#include + +#include + +#if defined(__CloudABI__) +#include +#endif + +/*` +[heading `BOOST_LIB_C_CLOUDABI`] + +[@https://github.com/NuxiNL/cloudlibc cloudlibc] - CloudABI's standard C library. +Version number available as major, and minor. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__cloudlibc__`] [__predef_detection__]] + + [[`__cloudlibc_major__`, `__cloudlibc_minor__`] [V.R.0]] + ] + */ + +#define BOOST_LIB_C_CLOUDABI BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__cloudlibc__) +# undef BOOST_LIB_C_CLOUDABI +# define BOOST_LIB_C_CLOUBABI \ + BOOST_VERSION_NUMBER(__cloudlibc_major__,__cloudlibc_minor__,0) +#endif + +#if BOOST_LIB_C_CLOUDABI +# define BOOST_LIB_C_CLOUDABI_AVAILABLE +#endif + +#define BOOST_LIB_C_CLOUDABI_NAME "cloudlibc" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_CLOUDABI,BOOST_LIB_C_CLOUDABI_NAME) diff --git a/include/boost/predef/platform.h b/include/boost/predef/platform.h index 86ca707..6c366d5 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt) #define BOOST_PREDEF_PLATFORM_H #endif +#include #include #include #include diff --git a/include/boost/predef/platform/cloudabi.h b/include/boost/predef/platform/cloudabi.h new file mode 100644 index 0000000..c44f689 --- /dev/null +++ b/include/boost/predef/platform/cloudabi.h @@ -0,0 +1,43 @@ +/* + Copyright 2017 James E. King, III + 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_PLAT_CLOUDABI_H +#define BOOST_PREDEF_PLAT_CLOUDABI_H + +#include +#include + +/*` +[heading `BOOST_PLAT_CLOUDABI`] + +[@https://github.com/NuxiNL/cloudabi CloudABI] platform. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__CloudABI__`] [__predef_detection__]] + ] + */ + +#define BOOST_PLAT_CLOUDABI BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__CloudABI__) +# undef BOOST_PLAT_CLOUDABI +# define BOOST_PLAT_CLOUDABI BOOST_VERSION_NUMBER_AVAILABLE +#endif + +#if BOOST_PLAT_CLOUDABI +# define BOOST_PLAT_CLOUDABI_AVAILABLE +# include +#endif + +#define BOOST_PLAT_CLOUDABI_NAME "CloudABI" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_CLOUDABI,BOOST_PLAT_CLOUDABI_NAME)