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

Merge pull request #118 from denzor200/fix/config_for_old_stdcpp

Fix for using config.hpp in old standards
This commit is contained in:
Antony Polukhin
2023-01-07 18:37:50 +03:00
committed by GitHub
57 changed files with 48 additions and 8 deletions

View File

@@ -8,7 +8,14 @@
#define BOOST_PFR_CONFIG_HPP
#pragma once
#if __cplusplus >= 201402L || (defined(_MSC_VER) && defined(_MSVC_LANG) && _MSC_VER > 1900)
#include <type_traits> // to get non standard platform macro definitions (__GLIBCXX__ for example)
#endif
/// \file boost/pfr/config.hpp
/// Contains all the macros that describe Boost.PFR configuration, like BOOST_PFR_ENABLED
///
/// \note This header file doesn't require C++14 Standard and supports all C++ compilers, even pre C++14 compilers (C++11, C++03...).
// Reminder:
// * MSVC++ 14.2 _MSC_VER == 1927 <- Loophole is known to work (Visual Studio ????)

9
test/Jamfile Normal file
View File

@@ -0,0 +1,9 @@
# Copyright (C) 2023 Denis Mikhailov
#
# Use, modification and distribution is subject to 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)
#
build-project config ;
build-project core ;

View File

@@ -32,6 +32,10 @@ skip_tags: true
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-9.0
ADDRMD: 32
CXXSTD: latest # fake
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# TOOLSET: msvc # TODO: clang-win ???
# ADDRMD: 32,64

22
test/config/Jamfile.v2 Normal file
View File

@@ -0,0 +1,22 @@
# Copyright (C) 2023 Denis Mikhailov
#
# Use, modification and distribution is subject to 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)
#
import python ;
import testing ;
import ../../config/checks/config : requires ;
project
: source-location .
: requirements
<define>BOOST_PFR_DETAIL_STRICT_RVALUE_TESTING=1
;
test-suite pfr_tests
:
[ run print_config.cpp : : : <test-info>always_show_run_output : auto_engine_config ]
;

View File

@@ -40,7 +40,7 @@ explicit compiler_supports_loophole ;
local DISABLE_ON_MSVC = ; #<toolset>msvc:<build>no ;
local REQUIRE_LOOPHOLE =
[ check-target-builds ../test//compiler_supports_loophole : : <build>no ]
[ check-target-builds ../core//compiler_supports_loophole : : <build>no ]
;
local STRUCTURED_BINDING_ENGINE = <define>BOOST_PFR_USE_LOOPHOLE=0 <define>BOOST_PFR_USE_CPP17=1 [ requires cxx17_structured_bindings ] ;
@@ -49,8 +49,6 @@ local CLASSIC_ENGINE = <define>BOOST_PFR_USE_LOOPHOLE=0 <define>BOOST_PFR_USE_CP
test-suite pfr_tests
:
[ run print_config.cpp : : : <test-info>always_show_run_output : auto_engine_config ]
[ run offset_based_getter.cpp ]
[ run can_be_as_fallback_in_the_fusion.cpp ]
@@ -62,9 +60,9 @@ test-suite pfr_tests
[ run test_tuple_sizes_on.cpp : : : <define>BOOST_PFR_RUN_TEST_ON="std::size_t" : test_tuple_sizes_on_size_ts ]
[ run run/motivating_example.cpp : : : : auto_engine_motivating ]
[ run ../example/sample_printing.cpp : : : : auto_engine_sample_printing ]
[ run ../example/get.cpp : : : : auto_engine_get ]
[ run ../example/quick_examples.cpp : : : : auto_engine_quick ]
[ run ../../example/sample_printing.cpp : : : : auto_engine_sample_printing ]
[ run ../../example/get.cpp : : : : auto_engine_get ]
[ run ../../example/quick_examples.cpp : : : : auto_engine_quick ]
;
local BLACKLIST_TESTS_FOR_LOOPHOLE =
@@ -97,7 +95,7 @@ local BLACKLIST_TESTS_FOR_CLASSIC =
tie_anonymous_const_field
;
for local source_file in [ glob ./run/*.cpp ] [ glob ../example/*.cpp ]
for local source_file in [ glob ./run/*.cpp ] [ glob ../../example/*.cpp ]
{
local target_name = $(source_file[1]:B) ;
pfr_tests += [ run $(source_file) : : : $(STRUCTURED_BINDING_ENGINE) : $(target_name)_sb ] ;
@@ -131,5 +129,5 @@ for local source_file in [ glob ./compile-fail/*.cpp ]
if [ python.configured ]
{
testing.make-test run-pyd : ../misc/generate_cpp17.py ;
testing.make-test run-pyd : ../../misc/generate_cpp17.py ;
}