2
0
mirror of https://github.com/boostorg/outcome.git synced 2026-01-19 04:22:13 +00:00

Began merging the latest tooling improvements from AFIO into Outcome

This commit is contained in:
Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)
2016-08-06 20:10:53 +01:00
parent adaf1a6255
commit 2165872a8b
7 changed files with 391 additions and 272 deletions

View File

@@ -12,6 +12,7 @@ if(${boost_lite_idx} EQUAL -1)
endif()
include(BoostLiteRequireOutOfSourceBuild)
include(BoostLiteUtils)
include(BoostLitePolicies)
# Parse the version we tell cmake directly from the version header file
ParseProjectVersionFromHpp("${CMAKE_CURRENT_SOURCE_DIR}/include/boost/outcome/version.hpp" VERSIONSTRING)
@@ -21,8 +22,8 @@ project(outcome VERSION ${VERSIONSTRING} LANGUAGES CXX)
set(PROJECT_NAMESPACE boost--)
# This file should be updated with the last git SHA next commit
UpdateRevisionHppFromGit("${CMAKE_CURRENT_SOURCE_DIR}/include/boost/outcome/revision.hpp")
# Bring in CTest support
include(CTest)
# Setup this cmake environment for this project
include(BoostLiteSetupProject)
# Find my library dependencies
find_boostish_library(boost-lite 1.0 REQUIRED)
@@ -43,6 +44,7 @@ all_compile_features(PUBLIC
cxx_thread_local
#cxx_init_captures ## Not supported yet by cmake 3.6
cxx_attributes
cxx_generic_lambdas
)
if(NOT MSVC OR CMAKE_VERSION VERSION_GREATER 3.59)
all_compile_features(PUBLIC

488
Doxyfile

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,17 @@
//! \file outcome/outcome.hpp The master *latest version* Outcome include file. All Outcome consuming libraries should include this header only.
#include "version.hpp"
#if defined(_MSC_VER) && !defined(__clang)
#if defined(_MSC_VER) && !defined(__clang__)
#define BOOST_OUTCOME_HEADERS_PATH2 BOOST_OUTCOME_VERSION_GLUE(v, BOOST_OUTCOME_HEADERS_VERSION, /monad.hpp)
#else
#define BOOST_OUTCOME_HEADERS_PATH2 BOOST_OUTCOME_VERSION_GLUE(v, BOOST_OUTCOME_HEADERS_VERSION,)/monad.hpp
#endif
#undef BOOST_OUTCOME_MODULE_NAME
#if defined(__cpp_modules)
#if defined(_MSC_VER) && !defined(__clang)
#define BOOST_OUTCOME_MODULE_NAME BOOST_OUTCOME_VERSION_GLUE(afio_v, BOOST_OUTCOME_NAMESPACE_VERSION,)
#else
#define BOOST_OUTCOME_MODULE_NAME BOOST_OUTCOME_VERSION_GLUE(afio_v, BOOST_OUTCOME_NAMESPACE_VERSION,)
#endif
#endif
#define BOOST_OUTCOME_HEADERS_PATH4(a) #a
#define BOOST_OUTCOME_HEADERS_PATH3(a) BOOST_OUTCOME_HEADERS_PATH4(a)
//! \brief The Outcome headers path generated by the preprocessor from the version
#define BOOST_OUTCOME_HEADERS_PATH BOOST_OUTCOME_HEADERS_PATH3(BOOST_OUTCOME_HEADERS_PATH2)
#include BOOST_OUTCOME_HEADERS_PATH
#undef BOOST_OUTCOME_HEADERS_PATH
#undef BOOST_OUTCOME_HEADERS_PATH2

View File

@@ -29,6 +29,11 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
//! \file config.hpp Configures a compiler environment for Outcome header code
//! \defgroup config Configuration macros
#define BOOST_OUTCOME_CONFIGURED
// Pull in detection of __MINGW64_VERSION_MAJOR
#ifdef __MINGW32__
#include <_mingw.h>
@@ -54,13 +59,10 @@ DEALINGS IN THE SOFTWARE.
#ifndef __cpp_variable_templates
#error Boost.Outcome needs variable template support in the compiler
#endif
#ifndef __cpp_generic_lambdas
#error Boost.AFIO needs generic lambda support in the compiler
#endif
#if defined(BOOST_OUTCOME_LATEST_VERSION) && BOOST_OUTCOME_LATEST_VERSION < 1
#error You need to include the latest version of Boost.Outcome before any earlier versions within the same translation unit
#endif
#ifndef BOOST_OUTCOME_LATEST_VERSION
#define BOOST_OUTCOME_LATEST_VERSION 1
#endif
#include "../boost-lite/include/import.h"
#undef BOOST_OUTCOME_V1_STL11_IMPL
@@ -80,6 +82,7 @@ DEALINGS IN THE SOFTWARE.
#error Boost.Outcome requires that Boost.Thread be configured to v3 or later
#endif
#else
//! \brief The C++ 11 STL to use (std|boost). Defaults to std. \ingroup config
#define BOOST_OUTCOME_V1_STL11_IMPL std
#ifndef BOOST_OUTCOME_USE_BOOST_THREAD
#define BOOST_OUTCOME_USE_BOOST_THREAD 0
@@ -88,18 +91,70 @@ DEALINGS IN THE SOFTWARE.
#if BOOST_OUTCOME_USE_BOOST_ERROR_CODE
#define BOOST_OUTCOME_V1_ERROR_CODE_IMPL boost
#else
//! \brief The C++ 11 `error_code` to use (std|boost). Defaults to std. \ingroup config
#define BOOST_OUTCOME_V1_ERROR_CODE_IMPL std
#endif
#ifdef BOOST_OUTCOME_UNSTABLE_VERSION
#include "../revision.hpp"
#define BOOST_OUTCOME_V1 (boost), (outcome), (BOOSTLITE_BIND_NAMESPACE_VERSION(v1, BOOST_OUTCOME_V1_STL11_IMPL, BOOST_OUTCOME_V1_ERROR_CODE_IMPL, BOOST_OUTCOME_PREVIOUS_COMMIT_UNIQUE), inline)
#define BOOST_OUTCOME_V1 (boost), (outcome), (BOOSTLITE_BIND_NAMESPACE_VERSION(v, BOOST_OUTCOME_NAMESPACE_VERSION, BOOST_OUTCOME_V1_STL11_IMPL, BOOST_OUTCOME_V1_ERROR_CODE_IMPL, BOOST_OUTCOME_PREVIOUS_COMMIT_UNIQUE), inline)
#elif BOOST_OUTCOME_LATEST_VERSION == 1
#define BOOST_OUTCOME_V1 (boost), (outcome), (BOOSTLITE_BIND_NAMESPACE_VERSION(v1, BOOST_OUTCOME_V1_STL11_IMPL, BOOST_OUTCOME_V1_ERROR_CODE_IMPL), inline)
#define BOOST_OUTCOME_V1 (boost), (outcome), (BOOSTLITE_BIND_NAMESPACE_VERSION(v, BOOST_OUTCOME_NAMESPACE_VERSION, BOOST_OUTCOME_V1_STL11_IMPL, BOOST_OUTCOME_V1_ERROR_CODE_IMPL), inline)
#else
#define BOOST_OUTCOME_V1 (boost), (outcome), (BOOSTLITE_BIND_NAMESPACE_VERSION(v1, BOOST_OUTCOME_V1_STL11_IMPL, BOOST_OUTCOME_V1_ERROR_CODE_IMPL))
#define BOOST_OUTCOME_V1 (boost), (outcome), (BOOSTLITE_BIND_NAMESPACE_VERSION(v, BOOST_OUTCOME_NAMESPACE_VERSION, BOOST_OUTCOME_V1_STL11_IMPL, BOOST_OUTCOME_V1_ERROR_CODE_IMPL))
#endif
#if defined(GENERATING_CXX_MODULE_INTERFACE)
/*! \def BOOST_OUTCOME_V1
\ingroup config
\brief The namespace configuration of this Boost.Outcome v1. Consists of a sequence
of bracketed tokens later fused by the preprocessor into namespace and C++ module names.
*/
#if DOXYGEN_SHOULD_SKIP_THIS
//! The Boost namespace
namespace boost
{
//! The Outcome namespace
namespace outcome
{
//! Inline namespace for this version of Outcome
inline namespace v1_xxx
{
}
}
}
/*! \brief The namespace of this Boost.Outcome v1 which will be some unknown inline
namespace starting with `v1_` inside the `boost::afio` namespace.
\ingroup config
*/
#define BOOST_OUTCOME_V1_NAMESPACE boost::outcome::v1_xxx
/*! \brief Expands into the appropriate namespace markup to enter the Outcome v1 namespace.
\ingroup config
*/
#define BOOST_OUTCOME_V1_NAMESPACE_BEGIN \
namespace boost \
{ \
namespace outcome \
{ \
inline namespace v1_xxx \
{
/*! \brief Expands into the appropriate namespace markup to enter the C++ module
exported Outcome v1 namespace.
\ingroup config
*/
#define BOOST_OUTCOME_V1_NAMESPACE_EXPORT_BEGIN \
export namespace boost \
{ \
namespace outcome \
{ \
inline namespace v1_xxx \
{
/*! \brief Expands into the appropriate namespace markup to exit the Outcome v1 namespace.
\ingroup config
*/
#define BOOST_OUTCOME_V1_NAMESPACE_END \
} \
} \
}
#elif defined(GENERATING_CXX_MODULE_INTERFACE)
#define BOOST_OUTCOME_V1_NAMESPACE BOOSTLITE_BIND_NAMESPACE(BOOST_OUTCOME_V1)
#define BOOST_OUTCOME_V1_NAMESPACE_BEGIN BOOSTLITE_BIND_NAMESPACE_BEGIN(BOOST_OUTCOME_V1)
#define BOOST_OUTCOME_V1_NAMESPACE_EXPORT_BEGIN BOOSTLITE_BIND_NAMESPACE_EXPORT_BEGIN(BOOST_OUTCOME_V1)

View File

@@ -29,6 +29,61 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#undef BOOST_OUTCOME_VERSION_MAJOR
#undef BOOST_OUTCOME_VERSION_MINOR
#undef BOOST_OUTCOME_VERSION_PATCH
// Remove any previously defined versioning
#undef BOOST_OUTCOME_VERSION_REVISION
#undef BOOST_OUTCOME_VERSION_GLUE2
#undef BOOST_OUTCOME_VERSION_GLUE
#undef BOOST_OUTCOME_HEADERS_VERSION
#undef BOOST_OUTCOME_NAMESPACE_VERSION
#undef BOOST_OUTCOME_MODULE_NAME
#define BOOST_OUTCOME_VERSION_GLUE2(a, b, c) a ## b ## c
#define BOOST_OUTCOME_VERSION_GLUE(a, b, c) BOOST_OUTCOME_VERSION_GLUE2(a, b, c)
// Hard coded as this is a specific version
#define BOOST_OUTCOME_VERSION_MAJOR 1
#define BOOST_OUTCOME_VERSION_MINOR 0
#define BOOST_OUTCOME_VERSION_PATCH 0
#define BOOST_OUTCOME_VERSION_REVISION 0
//! \brief The namespace boost::outcome::v ## BOOST_OUTCOME_NAMESPACE_VERSION
#define BOOST_OUTCOME_NAMESPACE_VERSION BOOST_OUTCOME_VERSION_GLUE(BOOST_OUTCOME_VERSION_MAJOR, _, BOOST_OUTCOME_VERSION_MINOR)
#if defined(__cpp_modules) || defined(DOXYGEN_SHOULD_SKIP_THIS)
#if defined(_MSC_VER) && !defined(__clang__)
//! \brief The Outcome C++ module name
#define BOOST_OUTCOME_MODULE_NAME BOOST_OUTCOME_VERSION_GLUE(outcome_v, BOOST_OUTCOME_NAMESPACE_VERSION,)
#else
//! \brief The Outcome C++ module name
#define BOOST_OUTCOME_MODULE_NAME BOOST_OUTCOME_VERSION_GLUE(outcome_v, BOOST_OUTCOME_NAMESPACE_VERSION,)
#endif
#endif
// If C++ Modules are on and we are not compiling the library,
// we are either generating the interface or importing
#if defined(__cpp_modules)
#if defined(GENERATING_CXX_MODULE_INTERFACE)
// We are generating this module's interface
#define BOOSTLITE_HEADERS_ONLY 0
#define BOOST_OUTCOME_HEADERS_ONLY 0
#define BOOST_OUTCOME_INCLUDE_ALL
#elif defined(BOOST_OUTCOME_SOURCE)
// We are implementing this module
#define BOOST_OUTCOME_INCLUDE_ALL
#else
// We are importing this module
import BOOST_OUTCOME_MODULE_NAME;
#undef BOOST_OUTCOME_INCLUDE_ALL
#endif
#else
// C++ Modules not on, therefore include as usual
#define BOOST_OUTCOME_INCLUDE_ALL
#endif
#ifdef BOOST_OUTCOME_INCLUDE_ALL
#include "config.hpp"
#ifndef BOOST_OUTCOME_MONAD_H
@@ -2336,3 +2391,4 @@ catch(...)
#endif
#endif

View File

@@ -1,3 +1,4 @@
//! \file version.hpp Controls the version of Outcome for cmake, shared library and C++ namespace mangling
#undef BOOST_OUTCOME_VERSION_MAJOR
#undef BOOST_OUTCOME_VERSION_MINOR
#undef BOOST_OUTCOME_VERSION_PATCH
@@ -7,23 +8,24 @@
#undef BOOST_OUTCOME_HEADERS_VERSION
#undef BOOST_OUTCOME_NAMESPACE_VERSION
#define BOOST_OUTCOME_VERSION_MAJOR 1 // Major version for cmake and DLL version stamping
#define BOOST_OUTCOME_VERSION_MINOR 0 // Minor version for cmake and DLL version stamping
#define BOOST_OUTCOME_VERSION_PATCH 0 // Patch version for cmake and DLL version stamping
//! \brief Major version for cmake and DLL version stamping \ingroup config
#define BOOST_OUTCOME_VERSION_MAJOR 1
//! \brief Minor version for cmake and DLL version stamping \ingroup config
#define BOOST_OUTCOME_VERSION_MINOR 0
//! \brief Patch version for cmake and DLL version stamping \ingroup config
#define BOOST_OUTCOME_VERSION_PATCH 0
//! \brief Revision version for cmake and DLL version stamping \ingroup config
#define BOOST_OUTCOME_VERSION_REVISION 0 // Revision version for cmake and DLL version stamping
// Defined between stable releases of Outcome
//! \brief Defined between stable releases of Outcome. It means the inline namespace
//! will be permuted per-commit to ensure ABI uniqueness. \ingroup config
#define BOOST_OUTCOME_UNSTABLE_VERSION
#define BOOST_OUTCOME_VERSION_GLUE2(a, b, c) a ## b ## c
#define BOOST_OUTCOME_VERSION_GLUE(a, b, c) BOOST_OUTCOME_VERSION_GLUE2(a, b, c)
// The namespace boost::afio::v ## BOOST_OUTCOME_NAMESPACE_VERSION
#define BOOST_OUTCOME_NAMESPACE_VERSION BOOST_OUTCOME_VERSION_GLUE(BOOST_OUTCOME_VERSION_MAJOR, _, BOOST_OUTCOME_VERSION_MINOR)
#if defined(_MSC_VER) && !defined(__clang)
// The path for the headers v ## BOOST_OUTCOME_HEADERS_VERSION
#if defined(_MSC_VER) && !defined(__clang__)
#define BOOST_OUTCOME_HEADERS_VERSION BOOST_OUTCOME_VERSION_GLUE(BOOST_OUTCOME_VERSION_MAJOR, ., BOOST_OUTCOME_VERSION_MINOR)
#else
// The path for the headers v ## BOOST_OUTCOME_HEADERS_VERSION
#define BOOST_OUTCOME_HEADERS_VERSION BOOST_OUTCOME_VERSION_MAJOR.BOOST_OUTCOME_VERSION_MINOR
#endif

4
index.html Normal file
View File

@@ -0,0 +1,4 @@
<html>
<head><meta http-equiv="refresh" content="0; url=doc/html/index.html" /></head>
<body>Please go to <a href="doc/index.html">doc/html/index.html</a></body>
</html>