Compare commits

..

2 Commits

Author SHA1 Message Date
7d5d019900 glob headers 2022-07-05 10:48:48 +02:00
ff7f512a45 Rework as esp-idf component 2022-07-04 20:19:34 +02:00
4 changed files with 88 additions and 99 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 2021-2022 Andrey Semashev # Copyright 2021 Andrey Semashev
# #
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) # (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
@@ -35,7 +35,7 @@ jobs:
# Linux, gcc # Linux, gcc
- toolset: gcc-4.4 - toolset: gcc-4.4
cxxstd: "98,0x" cxxstd: "98,0x"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- g++-4.4 - g++-4.4
@@ -43,7 +43,7 @@ jobs:
- "ppa:ubuntu-toolchain-r/test" - "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.6 - toolset: gcc-4.6
cxxstd: "03,0x" cxxstd: "03,0x"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- g++-4.6 - g++-4.6
@@ -51,49 +51,45 @@ jobs:
- "ppa:ubuntu-toolchain-r/test" - "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.7 - toolset: gcc-4.7
cxxstd: "03,11" cxxstd: "03,11"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- g++-4.7 - g++-4.7
- toolset: gcc-4.8 - toolset: gcc-4.8
cxxstd: "03,11" cxxstd: "03,11"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- g++-4.8 - g++-4.8
- toolset: gcc-4.9 - toolset: gcc-4.9
cxxstd: "03,11" cxxstd: "03,11"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- g++-4.9 - g++-4.9
- toolset: gcc-5 - toolset: gcc-5
cxxstd: "03,11,14,1z" cxxstd: "03,11,14,1z"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- g++-5 - g++-5
- toolset: gcc-6 - toolset: gcc-6
cxxstd: "03,11,14,1z" cxxstd: "03,11,14,1z"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- g++-6 - g++-6
- toolset: gcc-7 - toolset: gcc-7
cxxstd: "03,11,14,17" cxxstd: "03,11,14,17"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- g++-7 - g++-7
- toolset: gcc-8 - toolset: gcc-8
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- g++-8 - g++-8
- toolset: gcc-9 - toolset: gcc-9
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04 os: ubuntu-18.04
install: install:
- g++-9 - g++-9
- toolset: gcc-10 - toolset: gcc-10
@@ -102,94 +98,87 @@ jobs:
install: install:
- g++-10 - g++-10
- toolset: gcc-11 - toolset: gcc-11
cxxstd: "03,11,14,17,20,23" cxxstd: "03,11,14,17,20"
os: ubuntu-22.04 os: ubuntu-20.04
install: install:
- g++-11 - g++-11
- toolset: gcc-12 sources:
cxxstd: "03,11,14,17,20,23" - "ppa:ubuntu-toolchain-r/test"
os: ubuntu-22.04
install:
- g++-12
- name: UBSAN - name: UBSAN
toolset: gcc-11 toolset: gcc-11
cxxstd: "03,11,14,17,20,23" cxxstd: "03,11,14,17,20"
ubsan: 1 ubsan: 1
build_variant: debug build_variant: debug
os: ubuntu-22.04 os: ubuntu-20.04
install: install:
- g++-11 - g++-11
sources:
- "ppa:ubuntu-toolchain-r/test"
# Linux, clang # Linux, clang
- toolset: clang - toolset: clang
compiler: clang++-3.5 compiler: clang++-3.5
cxxstd: "03,11" cxxstd: "03,11"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- clang-3.5 - clang-3.5
- toolset: clang - toolset: clang
compiler: clang++-3.6 compiler: clang++-3.6
cxxstd: "03,11,14" cxxstd: "03,11,14"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- clang-3.6 - clang-3.6
- toolset: clang - toolset: clang
compiler: clang++-3.7 compiler: clang++-3.7
cxxstd: "03,11,14" cxxstd: "03,11,14"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- clang-3.7 - clang-3.7
- toolset: clang - toolset: clang
compiler: clang++-3.8 compiler: clang++-3.8
cxxstd: "03,11,14" cxxstd: "03,11,14"
os: ubuntu-latest os: ubuntu-20.04
container: ubuntu:16.04 container: ubuntu:16.04
install: install:
- clang-3.8 - clang-3.8
- toolset: clang - toolset: clang
compiler: clang++-3.9 compiler: clang++-3.9
cxxstd: "03,11,14" cxxstd: "03,11,14"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- clang-3.9 - clang-3.9
- toolset: clang - toolset: clang
compiler: clang++-4.0 compiler: clang++-4.0
cxxstd: "03,11,14" cxxstd: "03,11,14"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- clang-4.0 - clang-4.0
- toolset: clang - toolset: clang
compiler: clang++-5.0 compiler: clang++-5.0
cxxstd: "03,11,14,1z" cxxstd: "03,11,14,1z"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- clang-5.0 - clang-5.0
- toolset: clang - toolset: clang
compiler: clang++-6.0 compiler: clang++-6.0
cxxstd: "03,11,14,17" cxxstd: "03,11,14,17"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- clang-6.0 - clang-6.0
- toolset: clang - toolset: clang
compiler: clang++-7 compiler: clang++-7
cxxstd: "03,11,14,17" cxxstd: "03,11,14,17"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- clang-7 - clang-7
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode # Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
- toolset: clang - toolset: clang
compiler: clang++-8 compiler: clang++-8
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-latest os: ubuntu-18.04
container: ubuntu:18.04
install: install:
- clang-8 - clang-8
- g++-7 - g++-7
@@ -209,68 +198,42 @@ jobs:
- toolset: clang - toolset: clang
compiler: clang++-11 compiler: clang++-11
cxxstd: "03,11,14,17,20" cxxstd: "03,11,14,17,20"
os: ubuntu-22.04 os: ubuntu-20.04
install: install:
- clang-11 - clang-11
- toolset: clang - toolset: clang
compiler: clang++-12 compiler: clang++-12
cxxstd: "03,11,14,17,20,2b" cxxstd: "03,11,14,17,20"
os: ubuntu-22.04 os: ubuntu-20.04
install: install:
- clang-12 - clang-12
- toolset: clang - toolset: clang
compiler: clang++-13 compiler: clang++-12
cxxstd: "03,11,14,17,20,2b" cxxstd: "03,11,14,17,20"
os: ubuntu-22.04 os: ubuntu-20.04
install: install:
- clang-13 - clang-12
- toolset: clang - libc++-12-dev
compiler: clang++-14 - libc++abi-12-dev
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-14
- toolset: clang
compiler: clang++-15
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-15
sources:
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
source_keys:
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
- toolset: clang
compiler: clang++-15
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-15
- libc++-15-dev
- libc++abi-15-dev
sources:
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
source_keys:
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
cxxflags: -stdlib=libc++ cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++ linkflags: -stdlib=libc++
- name: UBSAN - name: UBSAN
toolset: clang toolset: clang
compiler: clang++-14 compiler: clang++-12
cxxstd: "03,11,14,17,20,2b" cxxstd: "03,11,14,17,20"
cxxflags: -stdlib=libc++ cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++ linkflags: -stdlib=libc++
ubsan: 1 ubsan: 1
build_variant: debug build_variant: debug
os: ubuntu-22.04 os: ubuntu-20.04
install: install:
- clang-14 - clang-12
- libc++-14-dev - libc++-12-dev
- libc++abi-14-dev - libc++abi-12-dev
- toolset: clang - toolset: clang
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: macos-11 os: macos-10.15
timeout-minutes: 60 timeout-minutes: 60
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
@@ -290,18 +253,12 @@ jobs:
if [ -f "/etc/debian_version" ] if [ -f "/etc/debian_version" ]
then then
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ] apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ python python3 perl git cmake
then
PYTHON_PACKAGE="python-is-python3"
else
PYTHON_PACKAGE="python"
fi
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake
fi fi
fi fi
git config --global pack.threads 0 git config --global pack.threads 0
- uses: actions/checkout@v3 - uses: actions/checkout@v2
- name: Install packages - name: Install packages
if: matrix.install if: matrix.install

View File

@@ -3,6 +3,8 @@
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
if(NOT DEFINED IDF_TARGET)
cmake_minimum_required(VERSION 3.5...3.20) cmake_minimum_required(VERSION 3.5...3.20)
project(boost_utility VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) project(boost_utility VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
@@ -22,3 +24,25 @@ target_link_libraries(boost_utility
Boost::throw_exception Boost::throw_exception
Boost::type_traits Boost::type_traits
) )
else()
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
idf_component_register(
SRCS
${headers}
INCLUDE_DIRS
include
REQUIRES
boost_config
boost_core
boost_io
boost_preprocessor
boost_static_assert
boost_throw_exception
boost_type_traits
)
endif()

View File

@@ -75,11 +75,24 @@ install:
- cd .. - cd ..
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root - git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root - cd boost-root
- git submodule update --init tools/boostdep - git submodule init tools/build
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\utility - git submodule init tools/boost_install
- python tools/boostdep/depinst/depinst.py %DEPINST_ARG_INCLUDE_EXAMPLES% --git_args "--jobs %GIT_FETCH_JOBS%" utility - git submodule init libs/headers
- git submodule init libs/assert
- git submodule init libs/config
- git submodule init libs/core
- git submodule init libs/io
- git submodule init libs/preprocessor
- git submodule init libs/static_assert
- git submodule init libs/throw_exception
- git submodule init libs/type_traits
- git submodule init libs/container_hash
- git submodule init libs/integer
- git submodule init libs/detail
- git submodule update --jobs %GIT_FETCH_JOBS%
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\utility\
- cmd /c bootstrap - cmd /c bootstrap
- b2 headers - b2 -d0 headers
build: off build: off

View File

@@ -23,7 +23,6 @@
#include <boost/io/ostream_put.hpp> #include <boost/io/ostream_put.hpp>
#include <boost/utility/string_view_fwd.hpp> #include <boost/utility/string_view_fwd.hpp>
#include <boost/throw_exception.hpp> #include <boost/throw_exception.hpp>
#include <boost/assert.hpp>
#include <cstddef> #include <cstddef>
#include <stdexcept> #include <stdexcept>
@@ -141,8 +140,6 @@ namespace boost {
void clear() BOOST_NOEXCEPT { len_ = 0; } // Boost extension void clear() BOOST_NOEXCEPT { len_ = 0; } // Boost extension
BOOST_CXX14_CONSTEXPR void remove_prefix(size_type n) { BOOST_CXX14_CONSTEXPR void remove_prefix(size_type n) {
BOOST_ASSERT(n <= size());
// This check is deprecated and is left for backward compatibility. It will be removed in the future.
if ( n > len_ ) if ( n > len_ )
n = len_; n = len_;
ptr_ += n; ptr_ += n;
@@ -150,8 +147,6 @@ namespace boost {
} }
BOOST_CXX14_CONSTEXPR void remove_suffix(size_type n) { BOOST_CXX14_CONSTEXPR void remove_suffix(size_type n) {
BOOST_ASSERT(n <= size());
// This check is deprecated and is left for backward compatibility. It will be removed in the future.
if ( n > len_ ) if ( n > len_ )
n = len_; n = len_;
len_ -= n; len_ -= n;