Compare commits

...

26 Commits

Author SHA1 Message Date
Andrey Semashev
43238b75ce Added AppVeyor CI config.
AppVeyor CI is useful for testing older MSVC versions that are no longer
supported by GitHub Actions.
2025-06-13 15:43:18 +03:00
Andrey Semashev
8651f245fe Added new gcc and clang jobs to GitHub Actions. 2025-06-13 15:43:18 +03:00
Andrey Semashev
5628638ade Added a workaround for MSVC 14.0 for BOOST_BITMASK.
Apparently, MSVC 14.0 does not import type aliases into namespaces via
a using-declaration. Work around the problem by enabling the use of
a compiler intrinsic for deducing the underlyng type of the enum.
2025-06-12 23:56:02 +03:00
Andrey Semashev
d3a556f694 Removed gcc 4.6 GitHub Action job.
The compiler doesn't support std::underlying_type trait,
which is needed by BOOST_BITMASK.
2025-06-12 19:01:48 +03:00
Andrey Semashev
d533b69b87 Removed windows-2019 GitHub Actions jobs.
The windows-2019 image is deprecated and will soon be removevd.
2025-06-12 18:41:01 +03:00
Andrey Semashev
1a28d9d60f Mark bitmask_set generated by BOOST_BITMASK as deprecated.
This function is not really needed and can be replaced with double
negation (!!) or comparison with an enum value of zero. We should
prefer to minimize polluting the user's namespace with new names.
2025-06-12 18:41:01 +03:00
Andrey Semashev
002caaa54f Added tests for BOOST_BITMASK. 2025-06-12 18:41:01 +03:00
Andrey Semashev
f7fdaf08a3 Use C++11 underlying_type trait in BOOST_BITMASK.
This bumps the language requirement to C++11, although for compilers
that support the __underlying_type intrinsic this may work even in C++03
mode.

The operators generated by BOOST_BITMASK now use proper underlying types
for casts, which means the operators will no longer truncate bits from
large enums.

Also mark the operators as noexcept and constexpr (since C++14).
2025-06-12 18:40:55 +03:00
Andrey Semashev
5b10a0b9b5 Removed outdated GHA images, added new compilers. 2025-04-19 19:19:12 +03:00
René Ferdinand Rivera Morell
a54b2619f8 Add support for modular build structure. (#24)
* Make the library modular usable.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Add missing b2 testing module import.

* Add missing import-search for cconfig/predef checks.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Update build deps.
2024-08-19 01:25:34 +03:00
Andrey Semashev
804767983f Added macos-12 and 13 testing in addition to latest (which is 14). 2024-05-21 01:18:57 +03:00
Andrey Semashev
a8a43b4778 Use macos-latest image as macos-11 is being removed. 2024-05-21 00:59:59 +03:00
Andrey Semashev
080df0554b Added a missing trailing newline. 2024-04-27 19:35:02 +03:00
Andrey Semashev
9c3a0022b2 Added gcc-13 and clang-17 CI jobs. 2024-02-06 00:44:24 +03:00
Andrey Semashev
6488652b08 Reduced CI job timeouts. 2024-02-05 23:43:39 +03:00
Andrey Semashev
8a0d14a862 Replaced actions/checkout usage with manual download commands.
This fixes the deprecation warnings for actions/checkout@v3. actions/checkout@v4
is not functional because of the upstream bug:

https://github.com/actions/checkout/issues/1590
2024-02-05 23:39:59 +03:00
Andrey Semashev
845567f026 Remove C++03 CI jobs, use gcc-11 libstdc++ in clang-12 through 15. 2023-11-17 20:07:56 +03:00
Andrey Semashev
b75c261492 Add clang-16 CI jobs, switch to clang-15 from stock Ubuntu repos. 2023-06-05 15:36:30 +03:00
Andrey Semashev
c6dac76110 Updated to GHA checkout@v3 to avoid deprecation warnings. 2022-10-18 17:56:52 +03:00
Andrey Semashev
15cc27d2bd GitHub Actions config update.
- Added gcc-12 and clang-13 through 15 jobs.
- Added C++23 testing for gcc and clang on Linux.
- Updated clang version for UBSAN job.
- Updated Ubuntu version for clang jobs to avoid having to use external APT
  repository.
- Updated python package installation for compatibility with Ubuntu 22.04.
2022-09-10 01:09:35 +03:00
Andrey Semashev
f9888ad051 Use ubuntu-latest for GHA CI jobs that run in a container. 2022-08-14 14:05:52 +03:00
Andrey Semashev
00efa0a0fb Removed compiler options that are not supported by clang-cl. 2022-08-14 11:36:17 +03:00
Andrey Semashev
c22d18ee32 Updated GHA config to resolve CI failures. 2022-08-14 11:01:16 +03:00
Andrey Semashev
0583b51d35 Updated GHA CI config to remove deprecated Windows and Ubuntu images. 2022-08-14 02:06:31 +03:00
Andrey Semashev
90d5395868 Switch to macos-11 GHA image as macos-10.15 is deprecated. 2022-08-12 15:56:52 +03:00
Andrey Semashev
8c603a1894 Fixed copyright character encoding in css.
Replaced ISO-8859-1 copyright character with (c) and changed the order
of date and name to be consistent with other copyrights.

Closes https://github.com/boostorg/detail/pull/22.
2022-02-03 11:58:40 +03:00
10 changed files with 605 additions and 153 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 2021 Andrey Semashev
# Copyright 2021-2025 Andrey Semashev
#
# 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)
@@ -33,209 +33,290 @@ jobs:
matrix:
include:
# Linux, gcc
- toolset: gcc-4.4
cxxstd: "98,0x"
os: ubuntu-20.04
container: ubuntu:16.04
install:
- g++-4.4
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.6
cxxstd: "03,0x"
os: ubuntu-20.04
container: ubuntu:16.04
install:
- g++-4.6
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.7
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.7
- toolset: gcc-4.8
cxxstd: "03,11"
os: ubuntu-18.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-4.8
- toolset: gcc-4.9
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.9
- toolset: gcc-5
cxxstd: "03,11,14,1z"
os: ubuntu-20.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-5
- toolset: gcc-6
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-6
- toolset: gcc-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-7
- toolset: gcc-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-8
- toolset: gcc-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-latest
container: ubuntu:20.04
install:
- g++-9
- toolset: gcc-10
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20"
os: ubuntu-latest
container: ubuntu:20.04
install:
- g++-10
- toolset: gcc-11
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20,23"
os: ubuntu-22.04
install:
- g++-11
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-12
cxxstd: "11,14,17,20,23"
os: ubuntu-22.04
install:
- g++-12
- toolset: gcc-13
cxxstd: "11,14,17,20,23"
os: ubuntu-24.04
install:
- g++-13
- toolset: gcc-14
cxxstd: "11,14,17,20,23,26"
os: ubuntu-24.04
install:
- g++-14
- toolset: gcc-15
cxxstd: "11,14,17,20,23,26"
os: ubuntu-latest
container: ubuntu:25.04
install:
- g++-15
- name: UBSAN
toolset: gcc-11
cxxstd: "03,11,14,17,20"
toolset: gcc-13
cxxstd: "11,14,17,20,23"
ubsan: 1
build_variant: debug
os: ubuntu-20.04
os: ubuntu-24.04
install:
- g++-11
sources:
- "ppa:ubuntu-toolchain-r/test"
- g++-13
# Linux, clang
- toolset: clang
compiler: clang++-3.5
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.5
- toolset: clang
compiler: clang++-3.6
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.6
- toolset: clang
compiler: clang++-3.7
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.7
- toolset: clang
compiler: clang++-3.8
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.8
- toolset: clang
compiler: clang++-3.9
cxxstd: "03,11,14"
os: ubuntu-18.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "03,11,14"
os: ubuntu-18.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-7
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
- toolset: clang
compiler: clang++-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-8
- g++-7
gcc_toolchain: 7
- toolset: clang
compiler: clang++-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
cxxstd: "11,14,17,2a"
os: ubuntu-latest
container: ubuntu:20.04
install:
- clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20"
os: ubuntu-latest
container: ubuntu:20.04
install:
- clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20"
os: ubuntu-22.04
install:
- clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-12
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-12
- libc++-12-dev
- libc++abi-12-dev
- clang-13
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-14
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-15
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
os: ubuntu-24.04
install:
- clang-16
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,23"
os: ubuntu-24.04
install:
- clang-17
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-18
cxxstd: "11,14,17,20,23,26"
os: ubuntu-24.04
install:
- clang-18
- g++-13
- toolset: clang
compiler: clang++-19
cxxstd: "11,14,17,20,23,26"
os: ubuntu-24.04
install:
- clang-19
- toolset: clang
compiler: clang++-20
cxxstd: "11,14,17,20,23,26"
os: ubuntu-latest
container: ubuntu:25.04
install:
- clang-20
- toolset: clang
compiler: clang++-20
cxxstd: "11,14,17,20,23,26"
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
os: ubuntu-latest
container: ubuntu:25.04
install:
- clang-20
- libc++-20-dev
- libc++abi-20-dev
- name: UBSAN
toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,20"
compiler: clang++-18
cxxstd: "11,14,17,20,23,26"
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
ubsan: 1
build_variant: debug
os: ubuntu-20.04
os: ubuntu-24.04
install:
- clang-12
- libc++-12-dev
- libc++abi-12-dev
- clang-18
- libc++-18-dev
- libc++abi-18-dev
- toolset: clang
cxxstd: "03,11,14,17,2a"
os: macos-10.15
cxxstd: "11,14,17,20,2b"
os: macos-13
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-14
timeout-minutes: 60
timeout-minutes: 15
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
@@ -253,13 +334,17 @@ jobs:
if [ -f "/etc/debian_version" ]
then
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
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
if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ]
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
git config --global pack.threads 0
- uses: actions/checkout@v2
- name: Install packages
if: matrix.install
run: |
@@ -374,11 +459,25 @@ jobs:
then
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
fi
mkdir -p snapshot
cd snapshot
echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
then
echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
ls -la
exit 1
fi
rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
cd ..
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
cd boost-root
mkdir -p libs/$LIBRARY
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
mkdir -p libs
rm -rf "libs/$LIBRARY"
mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
rm -rf "../snapshot"
git submodule update --init tools/boostdep
DEPINST_ARGS+=("$LIBRARY")
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
@@ -400,7 +499,7 @@ jobs:
- name: Run tests
if: matrix.cmake_tests == ''
run: |
cd ../boost-root
cd boost-root
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}")
if [ -n "${{matrix.build_variant}}" ]
then
@@ -433,24 +532,23 @@ jobs:
fail-fast: false
matrix:
include:
- toolset: msvc-14.1
- toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2022
- toolset: clang-win
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2016
- toolset: msvc-14.2
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2019
os: windows-2022
- toolset: gcc
cxxstd: "03,11,14,17,2a"
cxxstd: "11,14,17,20,23"
addrmd: 64
os: windows-2019
os: windows-2022
timeout-minutes: 15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Setup Boost
shell: cmd
run: |
@@ -464,10 +562,24 @@ jobs:
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
mkdir snapshot
cd snapshot
echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip
curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
if not exist "%LIBRARY%-%GITHUB_SHA%\" (
echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
dir
exit /b 1
)
del /f "%LIBRARY%-%GITHUB_SHA%.zip"
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
if not exist "libs\" mkdir libs
if exist "libs\%LIBRARY%\" rmdir /s /q "libs\%LIBRARY%"
move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
rmdir /s /q "..\snapshot"
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
cmd /c bootstrap
@@ -476,7 +588,7 @@ jobs:
- name: Run tests
shell: cmd
run: |
cd ../boost-root
cd boost-root
set BUILD_VARIANT=${{matrix.build_variant}}
if "%BUILD_VARIANT%" == "" set BUILD_VARIANT=%DEFAULT_BUILD_VARIANT%
b2 -j %NUMBER_OF_PROCESSORS% toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=%BUILD_VARIANT% libs/%LIBRARY%/test
b2 -j %NUMBER_OF_PROCESSORS% toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=%BUILD_VARIANT% embed-manifest-via=linker libs/%LIBRARY%/test

88
appveyor.yml Normal file
View File

@@ -0,0 +1,88 @@
# Copyright 2025 Andrey Semashev
# 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)
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- master
- develop
- /feature\/.*/
environment:
matrix:
- TOOLSET: msvc-12.0
ADDRMD: 32,64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: msvc-14.0
ADDRMD: 32,64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: msvc-14.1
CXXSTD: 14,17,latest
ADDRMD: 32,64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLSET: msvc-14.2
ADDRMD: 32,64
CXXSTD: 14,17,20,latest
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLSET: msvc-14.3
ADDRMD: 32,64
CXXSTD: 14,17,20,latest
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- TOOLSET: clang-win
ADDRMD: 32
CXXSTD: 14,17,latest
ENV_SCRIPT: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLSET: clang-win
ADDRMD: 64
CXXSTD: 14,17,latest
ENV_SCRIPT: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLSET: gcc
CXXSTD: 11,14,1z
ADDPATH: C:\cygwin\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 11,14,1z
ADDPATH: C:\cygwin64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 11,14,17
ADDPATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 11,14,17,2a
ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
install:
- set GIT_FETCH_JOBS=8
- set BOOST_BRANCH=develop
- if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
- cd ..
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule init tools/build
- git submodule init tools/boostdep
- git submodule init tools/boost_install
- git submodule init libs/headers
- git submodule init libs/config
- git submodule update --jobs %GIT_FETCH_JOBS%
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\detail
- python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" detail
- cmd /c bootstrap
- b2 -d0 headers
build: off
test_script:
- PATH=%ADDPATH%%PATH%
- if not "%ENV_SCRIPT%" == "" call "%ENV_SCRIPT%"
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
- if not "%THREADING%" == "" set THREADING=threading=%THREADING%
- b2 -j %NUMBER_OF_PROCESSORS% libs/detail/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% %THREADING%

27
build.jam Normal file
View File

@@ -0,0 +1,27 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# 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)
require-b2 5.2 ;
constant boost_dependencies :
/boost/config//boost_config
/boost/core//boost_core
/boost/preprocessor//boost_preprocessor
/boost/static_assert//boost_static_assert
/boost/type_traits//boost_type_traits ;
project /boost/detail
: common-requirements
<include>include
;
explicit
[ alias boost_detail : : : : <library>$(boost_dependencies) ]
[ alias all : boost_detail test ]
;
call-if : boost-library detail
;

View File

@@ -23,7 +23,7 @@ boostbook standalone
<xsl:param>generate.section.toc.level=3
<xsl:param>chunk.section.depth=2
#<xsl:param>chunk.first.sections=1
<dependency>images
<dependency>callouts
<dependency>css

View File

@@ -1,6 +1,6 @@
/*
<20> Copyright Beman Dawes, 2007
Copyright (c) 2007 Beman Dawes
Distributed under the Boost Software License, Version 1.0.
See www.boost.org/LICENSE_1_0.txt

View File

@@ -1,6 +1,7 @@
// boost/detail/bitmask.hpp ------------------------------------------------//
// Copyright Beman Dawes 2006
// Copyright Andrey Semashev 2025
// Distributed under the Boost Software License, Version 1.0
// http://www.boost.org/LICENSE_1_0.txt
@@ -18,41 +19,73 @@
#define BOOST_BITMASK_HPP
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#define BOOST_BITMASK(Bitmask) \
\
inline BOOST_CONSTEXPR Bitmask operator| (Bitmask x , Bitmask y ) \
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
| static_cast<boost::int_least32_t>(y)); } \
\
inline BOOST_CONSTEXPR Bitmask operator& (Bitmask x , Bitmask y ) \
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
& static_cast<boost::int_least32_t>(y)); } \
\
inline BOOST_CONSTEXPR Bitmask operator^ (Bitmask x , Bitmask y ) \
{ return static_cast<Bitmask>( static_cast<boost::int_least32_t>(x) \
^ static_cast<boost::int_least32_t>(y)); } \
\
inline BOOST_CONSTEXPR Bitmask operator~ (Bitmask x ) \
{ return static_cast<Bitmask>(~static_cast<boost::int_least32_t>(x)); } \
\
inline Bitmask & operator&=(Bitmask& x , Bitmask y) \
{ x = x & y ; return x ; } \
\
inline Bitmask & operator|=(Bitmask& x , Bitmask y) \
{ x = x | y ; return x ; } \
\
inline Bitmask & operator^=(Bitmask& x , Bitmask y) \
{ x = x ^ y ; return x ; } \
\
/* Boost extensions to [bitmask.types] */ \
\
inline BOOST_CONSTEXPR bool operator!(Bitmask x) \
{ return !static_cast<int>(x); } \
\
inline BOOST_CONSTEXPR bool bitmask_set(Bitmask x) \
#if defined(__has_builtin)
#if __has_builtin(__underlying_type)
#define BOOST_BITMASK_DETAIL_UNDERLYING_TYPE(enum_type) __underlying_type(enum_type)
#endif
#endif
#if !defined(BOOST_BITMASK_DETAIL_UNDERLYING_TYPE) && \
((defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 40700)) || (defined(_MSC_VER) && (_MSC_VER >= 1700)))
#define BOOST_BITMASK_DETAIL_UNDERLYING_TYPE(enum_type) __underlying_type(enum_type)
#endif
#if !defined(BOOST_BITMASK_DETAIL_UNDERLYING_TYPE)
#include <type_traits>
#endif
namespace boost {
namespace detail {
namespace bitmask {
#if defined(BOOST_BITMASK_DETAIL_UNDERLYING_TYPE)
template< typename Enum >
using underlying_type_t = BOOST_BITMASK_DETAIL_UNDERLYING_TYPE(Enum);
#elif (BOOST_CXX_VERSION >= 201402)
using std::underlying_type_t;
#else
template< typename Enum >
using underlying_type_t = typename std::underlying_type< Enum >::type;
#endif
}}}
#undef BOOST_BITMASK_DETAIL_UNDERLYING_TYPE
#define BOOST_BITMASK(Bitmask) \
\
inline BOOST_CONSTEXPR Bitmask operator| (Bitmask x, Bitmask y) BOOST_NOEXCEPT \
{ return static_cast< Bitmask >(static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(x) \
| static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(y)); } \
\
inline BOOST_CONSTEXPR Bitmask operator& (Bitmask x, Bitmask y) BOOST_NOEXCEPT \
{ return static_cast< Bitmask >(static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(x) \
& static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(y)); } \
\
inline BOOST_CONSTEXPR Bitmask operator^ (Bitmask x, Bitmask y) BOOST_NOEXCEPT \
{ return static_cast< Bitmask >(static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(x) \
^ static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(y)); } \
\
inline BOOST_CONSTEXPR Bitmask operator~ (Bitmask x) BOOST_NOEXCEPT \
{ return static_cast< Bitmask >(~static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(x)); } \
\
inline BOOST_CXX14_CONSTEXPR Bitmask& operator&=(Bitmask& x, Bitmask y) BOOST_NOEXCEPT \
{ x = x & y; return x; } \
\
inline BOOST_CXX14_CONSTEXPR Bitmask& operator|=(Bitmask& x, Bitmask y) BOOST_NOEXCEPT \
{ x = x | y; return x; } \
\
inline BOOST_CXX14_CONSTEXPR Bitmask& operator^=(Bitmask& x, Bitmask y) BOOST_NOEXCEPT \
{ x = x ^ y; return x; } \
\
/* Boost extensions to [bitmask.types] */ \
\
inline BOOST_CONSTEXPR bool operator!(Bitmask x) BOOST_NOEXCEPT \
{ return !static_cast< ::boost::detail::bitmask::underlying_type_t< Bitmask > >(x); } \
\
BOOST_DEPRECATED("bitmask_set(enum) is deprecated, use !!enum or comparison operators instead") \
inline BOOST_CONSTEXPR bool bitmask_set(Bitmask x) BOOST_NOEXCEPT \
{ return !!x; }
#endif // BOOST_BITMASK_HPP

View File

@@ -53,4 +53,4 @@ int cpp_main(int argc, char* argv[])
std::cout << std::endl;
return test_main(argc, argv);
}
}

View File

@@ -5,28 +5,33 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
################################################################################
import testing ;
import config : requires ;
build-project container_fwd ;
project detail/test
: requirements
<library>/boost/detail//boost_detail
<library>/boost/type_traits//boost_type_traits
<c++-template-depth>300
<toolset>clang:<cxxflags>-Wno-unused
<toolset>clang:<cxxflags>-Wno-tautological-compare
<toolset>clang:<cxxflags>-ftemplate-depth-300
<toolset>gcc:<cxxflags>-ftemplate-depth-300
<toolset>gcc:<define>_STLP_DEBUG
# Do not enable libstdc++ debug mode because of gcc 10.1 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95289
# <toolset>gcc:<define>_GLIBCXX_DEBUG
<toolset>darwin:<cxxflags>-ftemplate-depth-300
;
# import rules for testing conditional on config file variables
import ../../config/checks/config : requires ;
import-search /boost/config/checks ;
import config : requires ;
run binary_search_test.cpp ;
run blank_test.cpp ;
run is_sorted_test.cpp ;
run bitmask_test.cpp : : : [ requires cxx11_scoped_enums ] ;
run is_sorted_test.cpp /boost/array//boost_array ;
run numeric_traits_test.cpp ;
run is_xxx_test.cpp ;
run is_xxx_test.cpp /boost/preprocessor//boost_preprocessor ;
# run test_utf8_codecvt.cpp : : : [ requires std_wstreambuf ] ;
run test_utf8_codecvt.cpp ;
run allocator_utilities_test.cpp ;

184
test/bitmask_test.cpp Normal file
View File

@@ -0,0 +1,184 @@
/*
* 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)
*
* Copyright (c) 2025 Andrey Semashev
*/
#include <boost/detail/bitmask.hpp>
#include <boost/core/lightweight_test.hpp>
enum unscoped_enum
{
zero = 0,
one = 1,
two = 2,
four = 4
};
BOOST_BITMASK(unscoped_enum)
void test_unscoped_enum()
{
BOOST_TEST((one | two) == ((unscoped_enum)(1 | 2)));
BOOST_TEST((one & two) == ((unscoped_enum)(1 & 2)));
BOOST_TEST((one ^ two) == ((unscoped_enum)(1 ^ 2)));
BOOST_TEST((one | one) == ((unscoped_enum)(1 | 1)));
BOOST_TEST((one & one) == ((unscoped_enum)(1 & 1)));
BOOST_TEST((one ^ one) == ((unscoped_enum)(1 ^ 1)));
BOOST_TEST((~one) == ((unscoped_enum)(~1)));
{
unscoped_enum val = one;
val |= two;
BOOST_TEST(val == ((unscoped_enum)(1 | 2)));
}
{
unscoped_enum val = one;
val &= two;
BOOST_TEST(val == ((unscoped_enum)(1 & 2)));
}
{
unscoped_enum val = one;
val ^= two;
BOOST_TEST(val == ((unscoped_enum)(1 ^ 2)));
}
{
unscoped_enum val = one;
val |= one;
BOOST_TEST(val == ((unscoped_enum)(1 | 1)));
}
{
unscoped_enum val = one;
val &= one;
BOOST_TEST(val == ((unscoped_enum)(1 & 1)));
}
{
unscoped_enum val = one;
val ^= one;
BOOST_TEST(val == ((unscoped_enum)(1 ^ 1)));
}
BOOST_TEST(!zero);
BOOST_TEST(!!one);
}
enum class scoped_enum
{
none = 0,
x = 8,
y = 16,
z = 32
};
BOOST_BITMASK(scoped_enum)
void test_scoped_enum()
{
BOOST_TEST((scoped_enum::x | scoped_enum::y) == ((scoped_enum)(8 | 16)));
BOOST_TEST((scoped_enum::x & scoped_enum::y) == ((scoped_enum)(8 & 16)));
BOOST_TEST((scoped_enum::x ^ scoped_enum::y) == ((scoped_enum)(8 ^ 16)));
BOOST_TEST((scoped_enum::x | scoped_enum::x) == ((scoped_enum)(8 | 8)));
BOOST_TEST((scoped_enum::x & scoped_enum::x) == ((scoped_enum)(8 & 8)));
BOOST_TEST((scoped_enum::x ^ scoped_enum::x) == ((scoped_enum)(8 ^ 8)));
BOOST_TEST((~scoped_enum::x) == ((scoped_enum)(~8)));
{
scoped_enum val = scoped_enum::x;
val |= scoped_enum::y;
BOOST_TEST(val == ((scoped_enum)(8 | 16)));
}
{
scoped_enum val = scoped_enum::x;
val &= scoped_enum::y;
BOOST_TEST(val == ((scoped_enum)(8 & 16)));
}
{
scoped_enum val = scoped_enum::x;
val ^= scoped_enum::y;
BOOST_TEST(val == ((scoped_enum)(8 ^ 16)));
}
{
scoped_enum val = scoped_enum::x;
val |= scoped_enum::x;
BOOST_TEST(val == ((scoped_enum)(8 | 8)));
}
{
scoped_enum val = scoped_enum::x;
val &= scoped_enum::x;
BOOST_TEST(val == ((scoped_enum)(8 & 8)));
}
{
scoped_enum val = scoped_enum::x;
val ^= scoped_enum::x;
BOOST_TEST(val == ((scoped_enum)(8 ^ 8)));
}
BOOST_TEST(!scoped_enum::none);
BOOST_TEST(!!scoped_enum::x);
}
namespace my_namespace {
enum class namespaced_enum : unsigned int
{
empty = 0,
a = 64,
b = 128,
c = 256
};
BOOST_BITMASK(namespaced_enum)
} // namespace my_namespace
void test_namespaced_enum()
{
BOOST_TEST((my_namespace::namespaced_enum::a | my_namespace::namespaced_enum::b) == ((my_namespace::namespaced_enum)(64u | 128u)));
BOOST_TEST((my_namespace::namespaced_enum::a & my_namespace::namespaced_enum::b) == ((my_namespace::namespaced_enum)(64u & 128u)));
BOOST_TEST((my_namespace::namespaced_enum::a ^ my_namespace::namespaced_enum::b) == ((my_namespace::namespaced_enum)(64u ^ 128u)));
BOOST_TEST((my_namespace::namespaced_enum::a | my_namespace::namespaced_enum::a) == ((my_namespace::namespaced_enum)(64u | 64u)));
BOOST_TEST((my_namespace::namespaced_enum::a & my_namespace::namespaced_enum::a) == ((my_namespace::namespaced_enum)(64u & 64u)));
BOOST_TEST((my_namespace::namespaced_enum::a ^ my_namespace::namespaced_enum::a) == ((my_namespace::namespaced_enum)(64u ^ 64u)));
BOOST_TEST((~my_namespace::namespaced_enum::a) == ((my_namespace::namespaced_enum)(~64u)));
{
my_namespace::namespaced_enum val = my_namespace::namespaced_enum::a;
val |= my_namespace::namespaced_enum::b;
BOOST_TEST(val == ((my_namespace::namespaced_enum)(64u | 128u)));
}
{
my_namespace::namespaced_enum val = my_namespace::namespaced_enum::a;
val &= my_namespace::namespaced_enum::b;
BOOST_TEST(val == ((my_namespace::namespaced_enum)(64u & 128u)));
}
{
my_namespace::namespaced_enum val = my_namespace::namespaced_enum::a;
val ^= my_namespace::namespaced_enum::b;
BOOST_TEST(val == ((my_namespace::namespaced_enum)(64u ^ 128u)));
}
{
my_namespace::namespaced_enum val = my_namespace::namespaced_enum::a;
val |= my_namespace::namespaced_enum::a;
BOOST_TEST(val == ((my_namespace::namespaced_enum)(64u | 64u)));
}
{
my_namespace::namespaced_enum val = my_namespace::namespaced_enum::a;
val &= my_namespace::namespaced_enum::a;
BOOST_TEST(val == ((my_namespace::namespaced_enum)(64u & 64u)));
}
{
my_namespace::namespaced_enum val = my_namespace::namespaced_enum::a;
val ^= my_namespace::namespaced_enum::a;
BOOST_TEST(val == ((my_namespace::namespaced_enum)(64u ^ 64u)));
}
BOOST_TEST(!my_namespace::namespaced_enum::empty);
BOOST_TEST(!!my_namespace::namespaced_enum::a);
}
int main()
{
test_unscoped_enum();
test_scoped_enum();
test_namespaced_enum();
return boost::report_errors();
}

View File

@@ -9,9 +9,12 @@ project detail/test/container_fwd
: requirements
<warnings>all
<toolset>intel:<warnings>on
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
<toolset>clang:<cxxflags>"-pedantic -Wextra -Wmismatched-tags"
<toolset>gcc:<warnings>pedantic
<toolset>gcc:<cxxflags>"-Wstrict-aliasing -fstrict-aliasing -Wsign-promo -Wunused-parameter -Wconversion"
<toolset>darwin:<warnings>pedantic
<toolset>darwin:<cxxflags>"-Wstrict-aliasing -fstrict-aliasing -Wsign-promo -Wunused-parameter -Wconversion"
<toolset>clang:<warnings>pedantic
<toolset>clang:<cxxflags>"-Wmismatched-tags"
<warnings-as-errors>on
;