mirror of
https://github.com/boostorg/integer.git
synced 2025-06-25 20:11:41 +02:00
Compare commits
31 Commits
boost-1.78
...
develop
Author | SHA1 | Date | |
---|---|---|---|
0fefe9831a | |||
c4c7cafd41 | |||
b66e9a0aa8 | |||
5fd694fce2 | |||
2dfe66886d | |||
b774aa0d9e | |||
fbaf2dee58 | |||
318a38efde | |||
f1d7f7f80f | |||
b1b7f7c63d | |||
c37a3402be | |||
dea8e3445d | |||
bf1db7ad75 | |||
26c347560c | |||
23974e3087 | |||
e7ed9918c1 | |||
becbd39cc4 | |||
28ba36fd3a | |||
8ce66ab37e | |||
d4157bdf38 | |||
721fe9f562 | |||
88457d2de5 | |||
d22bf3ea37 | |||
c659255289 | |||
49195acf60 | |||
bc9b0e6177 | |||
c6564a2d2b | |||
16ef530fcf | |||
c5df07cb21 | |||
a832e8fe65 | |||
ba7ea7f846 |
366
.github/workflows/ci.yml
vendored
366
.github/workflows/ci.yml
vendored
@ -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,298 @@ 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
|
||||
cxxstd: "0x"
|
||||
os: ubuntu-latest
|
||||
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-gnu,14-gnu,17-gnu,20-gnu,23-gnu"
|
||||
os: ubuntu-22.04
|
||||
install:
|
||||
- g++-11
|
||||
sources:
|
||||
- "ppa:ubuntu-toolchain-r/test"
|
||||
- toolset: gcc-12
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu"
|
||||
os: ubuntu-22.04
|
||||
install:
|
||||
- g++-12
|
||||
- toolset: gcc-13
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu"
|
||||
os: ubuntu-24.04
|
||||
install:
|
||||
- g++-13
|
||||
- toolset: gcc-14
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu,26-gnu"
|
||||
os: ubuntu-24.04
|
||||
install:
|
||||
- g++-14
|
||||
- toolset: gcc-15
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu,26-gnu"
|
||||
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-gnu,14-gnu,17-gnu,20-gnu,23-gnu"
|
||||
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-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||
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-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||
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-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||
os: ubuntu-22.04
|
||||
install:
|
||||
- clang-14
|
||||
- g++-11
|
||||
gcc_toolchain: 11
|
||||
- toolset: clang
|
||||
compiler: clang++-15
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||
os: ubuntu-22.04
|
||||
install:
|
||||
- clang-15
|
||||
- g++-11
|
||||
gcc_toolchain: 11
|
||||
- toolset: clang
|
||||
compiler: clang++-16
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,2b-gnu"
|
||||
os: ubuntu-24.04
|
||||
install:
|
||||
- clang-16
|
||||
- g++-11
|
||||
gcc_toolchain: 11
|
||||
- toolset: clang
|
||||
compiler: clang++-17
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu"
|
||||
os: ubuntu-24.04
|
||||
install:
|
||||
- clang-17
|
||||
- g++-11
|
||||
gcc_toolchain: 11
|
||||
- toolset: clang
|
||||
compiler: clang++-18
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu,26-gnu"
|
||||
os: ubuntu-24.04
|
||||
install:
|
||||
- clang-18
|
||||
- g++-13
|
||||
- toolset: clang
|
||||
compiler: clang++-19
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu,26-gnu"
|
||||
os: ubuntu-24.04
|
||||
install:
|
||||
- clang-19
|
||||
- toolset: clang
|
||||
compiler: clang++-20
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu,26-gnu"
|
||||
os: ubuntu-latest
|
||||
container: ubuntu:25.04
|
||||
install:
|
||||
- clang-20
|
||||
- toolset: clang
|
||||
compiler: clang++-20
|
||||
cxxstd: "11-gnu,14-gnu,17-gnu,20-gnu,23-gnu,26-gnu"
|
||||
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-gnu,14-gnu,17-gnu,20-gnu,23-gnu,26-gnu"
|
||||
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}}
|
||||
|
||||
@ -252,14 +341,34 @@ jobs:
|
||||
echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV
|
||||
if [ -f "/etc/debian_version" ]
|
||||
then
|
||||
# Use Azure APT mirrors in containers to avoid HTTP errors due to DDoS filters triggered by lots of CI jobs launching concurrently.
|
||||
# Note that not all Ubuntu versions support "mirror+file:..." URIs in APT sources, so just use Azure mirrors exclusively.
|
||||
# Note also that on recent Ubuntu versions DEB822 format is used for source files.
|
||||
APT_SOURCES=()
|
||||
if [ -d "/etc/apt/sources.list.d" ]
|
||||
then
|
||||
readarray -t APT_SOURCES < <(find "/etc/apt/sources.list.d" -type f -name '*.sources' -print)
|
||||
fi
|
||||
if [ -f "/etc/apt/sources.list" ]
|
||||
then
|
||||
APT_SOURCES+=("/etc/apt/sources.list")
|
||||
fi
|
||||
if [ "${#APT_SOURCES[@]}" -gt 0 ]
|
||||
then
|
||||
sed -i -E -e 's!([^ ]+) (http|https)://(archive|security)\.ubuntu\.com/ubuntu[^ ]*(.*)!\1 http://azure.archive.ubuntu.com/ubuntu/\4!' "${APT_SOURCES[@]}"
|
||||
fi
|
||||
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 +483,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 +523,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
|
||||
@ -427,3 +550,70 @@ jobs:
|
||||
fi
|
||||
B2_ARGS+=("libs/$LIBRARY/test")
|
||||
./b2 "${B2_ARGS[@]}"
|
||||
|
||||
windows:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- 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-2022
|
||||
- toolset: gcc
|
||||
cxxstd: "11,14,17,20,23"
|
||||
addrmd: 64
|
||||
os: windows-2022
|
||||
|
||||
timeout-minutes: 15
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
run: |
|
||||
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
||||
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
||||
echo LIBRARY: %LIBRARY%
|
||||
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
||||
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
||||
echo GITHUB_REF: %GITHUB_REF%
|
||||
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
||||
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
|
||||
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
|
||||
b2 -d0 headers
|
||||
|
||||
- name: Run tests
|
||||
shell: cmd
|
||||
run: |
|
||||
cd boost-root
|
||||
if not "${{matrix.cxxstd}}" == "" set CXXSTD=cxxstd=${{matrix.cxxstd}}
|
||||
if not "${{matrix.addrmd}}" == "" set ADDRMD=address-model=${{matrix.addrmd}}
|
||||
if not "${{matrix.build_variant}}" == "" (set BUILD_VARIANT=variant=${{matrix.build_variant}}) else (set BUILD_VARIANT=variant=%DEFAULT_BUILD_VARIANT%)
|
||||
b2 -j %NUMBER_OF_PROCESSORS% libs/%LIBRARY%/test toolset=${{matrix.toolset}} %CXXSTD% %ADDRMD% %BUILD_VARIANT% embed-manifest-via=linker
|
||||
|
@ -19,4 +19,5 @@ target_link_libraries(boost_integer
|
||||
Boost::core
|
||||
Boost::static_assert
|
||||
Boost::throw_exception
|
||||
Boost::type_traits
|
||||
)
|
||||
|
26
appveyor.yml
26
appveyor.yml
@ -14,42 +14,40 @@ branches:
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0
|
||||
ADDRMD: 32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: msvc-14.0
|
||||
CXXSTD: 14,latest
|
||||
ADDRMD: 32,64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: msvc-14.1
|
||||
CXXSTD: 14,17
|
||||
CXXSTD: 14,17,latest
|
||||
ADDRMD: 32,64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: msvc-14.2
|
||||
ADDRMD: 32,64
|
||||
CXXSTD: 14,17
|
||||
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,64
|
||||
CXXSTD: 14,17
|
||||
CXXSTD: 14,17,latest
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
ADDPATH: C:\mingw\bin;
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
ADDPATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
|
||||
|
28
build.jam
Normal file
28
build.jam
Normal file
@ -0,0 +1,28 @@
|
||||
# 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/assert//boost_assert
|
||||
/boost/config//boost_config
|
||||
/boost/core//boost_core
|
||||
/boost/static_assert//boost_static_assert
|
||||
/boost/throw_exception//boost_throw_exception
|
||||
/boost/type_traits//boost_type_traits ;
|
||||
|
||||
project /boost/integer
|
||||
: common-requirements
|
||||
<include>include
|
||||
;
|
||||
|
||||
explicit
|
||||
[ alias boost_integer : : : : <library>$(boost_dependencies) ]
|
||||
[ alias all : boost_integer test ]
|
||||
;
|
||||
|
||||
call-if : boost-library integer
|
||||
;
|
||||
|
@ -285,7 +285,7 @@ The following table describes each template's criteria.
|
||||
[*only] if there exists a type with exactly N bits.]
|
||||
]
|
||||
[
|
||||
[[^boost::int_max_value_t<V>::last]]
|
||||
[[^boost::int_max_value_t<V>::least]]
|
||||
[The smallest, built-in, signed integral type that can hold all the values in the inclusive range ['0 - V].
|
||||
The parameter should be a positive number.]
|
||||
]
|
||||
|
@ -51,19 +51,20 @@ namespace boost {
|
||||
//
|
||||
// some helper functions which really should be constexpr already, but sadly aren't:
|
||||
//
|
||||
#ifndef BOOST_NO_CXX14_CONSTEXPR
|
||||
template <class T>
|
||||
inline constexpr T constexpr_min(T const& a, T const& b) BOOST_GCD_NOEXCEPT(T)
|
||||
inline BOOST_CONSTEXPR T constexpr_min(T const& a, T const& b) BOOST_GCD_NOEXCEPT(T)
|
||||
{
|
||||
return a < b ? a : b;
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX14_CONSTEXPR
|
||||
template <class T>
|
||||
inline constexpr auto constexpr_swap(T&a, T& b) BOOST_GCD_NOEXCEPT(T) -> decltype(a.swap(b))
|
||||
inline constexpr auto constexpr_swap(T& a, T& b) BOOST_GCD_NOEXCEPT(T) -> decltype(a.swap(b))
|
||||
{
|
||||
return a.swap(b);
|
||||
}
|
||||
template <class T, class U>
|
||||
inline constexpr void constexpr_swap(T&a, U& b...) BOOST_GCD_NOEXCEPT(T)
|
||||
inline constexpr void constexpr_swap(T& a, U& b, ...) BOOST_GCD_NOEXCEPT(T)
|
||||
{
|
||||
T t(static_cast<T&&>(a));
|
||||
a = static_cast<T&&>(b);
|
||||
@ -71,12 +72,7 @@ namespace boost {
|
||||
}
|
||||
#else
|
||||
template <class T>
|
||||
inline T constexpr_min(T const& a, T const& b) BOOST_GCD_NOEXCEPT(T)
|
||||
{
|
||||
return a < b ? a : b;
|
||||
}
|
||||
template <class T>
|
||||
inline void constexpr_swap(T&a, T& b) BOOST_GCD_NOEXCEPT(T)
|
||||
inline void constexpr_swap(T& a, T& b) BOOST_GCD_NOEXCEPT(T)
|
||||
{
|
||||
using std::swap;
|
||||
swap(a, b);
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/core/swap.hpp>
|
||||
#include <boost/core/invoke_swap.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
namespace boost { namespace integer {
|
||||
@ -38,7 +38,7 @@ extended_euclidean(Z m, Z n)
|
||||
if (m < n)
|
||||
{
|
||||
swapped = true;
|
||||
boost::swap(m, n);
|
||||
boost::core::invoke_swap(m, n);
|
||||
}
|
||||
Z u0 = m;
|
||||
Z u1 = 1;
|
||||
|
@ -4,7 +4,8 @@
|
||||
// Gives the integer part of the logarithm, in base 2, of a
|
||||
// given number. Behavior is undefined if the argument is <= 0.
|
||||
//
|
||||
// Copyright (c) 2003-2004, 2008 Gennaro Prota
|
||||
// Copyright (c) 2003-2004, 2008 Gennaro Prota
|
||||
// Copyright (c) 2022 Andrey Semashev
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -15,98 +16,102 @@
|
||||
#ifndef BOOST_INTEGER_INTEGER_LOG2_HPP
|
||||
#define BOOST_INTEGER_INTEGER_LOG2_HPP
|
||||
|
||||
#include <boost/limits.hpp>
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#if defined(BOOST_BORLANDC)
|
||||
#include <climits>
|
||||
#endif
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/core/bit.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
namespace detail {
|
||||
|
||||
template <typename T>
|
||||
int integer_log2_impl(T x, int n) {
|
||||
// helper to find the maximum power of two
|
||||
// less than p
|
||||
template< unsigned int p, unsigned int n, bool = ((2u * n) < p) >
|
||||
struct max_pow2_less :
|
||||
public max_pow2_less< p, 2u * n >
|
||||
{
|
||||
};
|
||||
|
||||
int result = 0;
|
||||
template< unsigned int p, unsigned int n >
|
||||
struct max_pow2_less< p, n, false >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned int, value = n);
|
||||
};
|
||||
|
||||
while (x != 1) {
|
||||
template< typename T >
|
||||
inline typename boost::disable_if< boost::is_integral< T >, int >::type integer_log2_impl(T x)
|
||||
{
|
||||
unsigned int n = detail::max_pow2_less<
|
||||
std::numeric_limits< T >::digits,
|
||||
CHAR_BIT / 2u
|
||||
>::value;
|
||||
|
||||
const T t = static_cast<T>(x >> n);
|
||||
if (t) {
|
||||
result += n;
|
||||
x = t;
|
||||
}
|
||||
n /= 2;
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// helper to find the maximum power of two
|
||||
// less than p (more involved than necessary,
|
||||
// to avoid PTS)
|
||||
//
|
||||
template <int p, int n>
|
||||
struct max_pow2_less {
|
||||
|
||||
enum { c = 2*n < p };
|
||||
|
||||
BOOST_STATIC_CONSTANT(int, value =
|
||||
c ? (max_pow2_less< c*p, 2*c*n>::value) : n);
|
||||
|
||||
};
|
||||
|
||||
template <>
|
||||
struct max_pow2_less<0, 0> {
|
||||
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
|
||||
// this template is here just for Borland :(
|
||||
// we could simply rely on numeric_limits but sometimes
|
||||
// Borland tries to use numeric_limits<const T>, because
|
||||
// of its usual const-related problems in argument deduction
|
||||
// - gps
|
||||
template <typename T>
|
||||
struct width {
|
||||
|
||||
#ifdef BOOST_BORLANDC
|
||||
BOOST_STATIC_CONSTANT(int, value = sizeof(T) * CHAR_BIT);
|
||||
int result = 0;
|
||||
while (x != 1)
|
||||
{
|
||||
T t(x >> n);
|
||||
if (t)
|
||||
{
|
||||
result += static_cast< int >(n);
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
x = static_cast< T&& >(t);
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(int, value = (std::numeric_limits<T>::digits));
|
||||
x = t;
|
||||
#endif
|
||||
}
|
||||
n >>= 1u;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} // detail
|
||||
|
||||
|
||||
// ---------
|
||||
// integer_log2
|
||||
// ---------------
|
||||
//
|
||||
template <typename T>
|
||||
int integer_log2(T x) {
|
||||
|
||||
BOOST_ASSERT(x > 0);
|
||||
|
||||
const int n = detail::max_pow2_less<
|
||||
detail::width<T> :: value, 4
|
||||
> :: value;
|
||||
|
||||
return detail::integer_log2_impl(x, n);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
inline typename boost::enable_if< boost::is_integral< T >, int >::type integer_log2_impl(T x)
|
||||
{
|
||||
// We could simply rely on numeric_limits but sometimes
|
||||
// Borland tries to use numeric_limits<const T>, because
|
||||
// of its usual const-related problems in argument deduction
|
||||
// - gps
|
||||
return static_cast< int >((sizeof(T) * CHAR_BIT - 1u) -
|
||||
boost::core::countl_zero(static_cast< typename boost::make_unsigned< T >::type >(x)));
|
||||
}
|
||||
|
||||
#if defined(BOOST_HAS_INT128)
|
||||
// We need to provide explicit overloads for __int128 because (a) boost/core/bit.hpp currently does not support it and
|
||||
// (b) std::numeric_limits are not specialized for __int128 in some standard libraries.
|
||||
inline int integer_log2_impl(boost::uint128_type x)
|
||||
{
|
||||
const boost::uint64_t x_hi = static_cast< boost::uint64_t >(x >> 64u);
|
||||
if (x_hi != 0u)
|
||||
return 127 - boost::core::countl_zero(x_hi);
|
||||
else
|
||||
return 63 - boost::core::countl_zero(static_cast< boost::uint64_t >(x));
|
||||
}
|
||||
|
||||
inline int integer_log2_impl(boost::int128_type x)
|
||||
{
|
||||
return detail::integer_log2_impl(static_cast< boost::uint128_type >(x));
|
||||
}
|
||||
#endif // defined(BOOST_HAS_INT128)
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
#endif // include guard
|
||||
// ------------
|
||||
// integer_log2
|
||||
// ------------
|
||||
template< typename T >
|
||||
inline int integer_log2(T x)
|
||||
{
|
||||
BOOST_ASSERT(x > 0);
|
||||
return detail::integer_log2_impl(x);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_INTEGER_INTEGER_LOG2_HPP
|
||||
|
@ -2,10 +2,13 @@
|
||||
#~ 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)
|
||||
|
||||
require-b2 5.0.1 ;
|
||||
import-search /boost/config/checks ;
|
||||
import config : requires ;
|
||||
import testing ;
|
||||
import ../../config/checks/config : requires ;
|
||||
|
||||
project : requirements <warnings>all <toolset>gcc:<cxxflags>-Wextra ;
|
||||
project : requirements <warnings>all <toolset>gcc:<cxxflags>-Wextra
|
||||
<library>/boost/integer//boost_integer ;
|
||||
|
||||
obj has_gmpxx : has_gmpxx.cpp ;
|
||||
explicit has_gmpxx ;
|
||||
@ -13,17 +16,18 @@ explicit has_gmpxx ;
|
||||
test-suite integer
|
||||
:
|
||||
[ run integer_traits_test.cpp ]
|
||||
[ run integer_test.cpp : : : <toolset>gcc:<cxxflags>-Wno-long-long <toolset>darwin:<cxxflags>-Wno-long-long <toolset>sun:<cxxflags>"-Qoption ccfe -tmpldepth=128" ]
|
||||
[ run integer_mask_test.cpp ]
|
||||
[ run static_log2_test.cpp ]
|
||||
[ run static_min_max_test.cpp ]
|
||||
[ run extended_euclidean_test.cpp ]
|
||||
[ run mod_inverse_test.cpp ]
|
||||
[ run integer_test.cpp : : : <library>/boost/mpl//boost_mpl <toolset>gcc:<cxxflags>-Wno-long-long <toolset>darwin:<cxxflags>-Wno-long-long <toolset>sun:<cxxflags>"-Qoption ccfe -tmpldepth=128" ]
|
||||
[ run integer_mask_test.cpp : : : <library>/boost/detail//boost_detail ]
|
||||
[ run integer_log2_test.cpp : : : <library>/boost/multiprecision//boost_multiprecision ]
|
||||
[ run static_log2_test.cpp : : : <library>/boost/detail//boost_detail ]
|
||||
[ run static_min_max_test.cpp : : : <library>/boost/detail//boost_detail ]
|
||||
[ run extended_euclidean_test.cpp : : : <library>/boost/multiprecision//boost_multiprecision ]
|
||||
[ run mod_inverse_test.cpp : : : <library>/boost/optional//boost_optional <library>/boost/multiprecision//boost_multiprecision ]
|
||||
[ compile integer_traits_include_test.cpp ]
|
||||
[ compile integer_include_test.cpp ]
|
||||
[ compile integer_mask_include_test.cpp ]
|
||||
[ compile static_log2_include_test.cpp ]
|
||||
[ compile static_min_max_include_test.cpp ]
|
||||
[ compile static_min_max_include_test.cpp : <library>/boost/detail//boost_detail ]
|
||||
[ compile integer_fwd_include_test.cpp ]
|
||||
[ compile gcd_constexpr14_test.cpp ]
|
||||
[ compile gcd_noexcept_test.cpp ]
|
||||
@ -34,5 +38,5 @@ test-suite integer
|
||||
[ compile-fail fail_uint_fast.cpp ]
|
||||
[ compile-fail fail_uint_least.cpp ]
|
||||
[ compile-fail fail_uint_65.cpp ]
|
||||
[ run common_factor_test.cpp : : : [ check-target-builds has_gmpxx "Checking for gmpxx.h" : <define>BOOST_INTEGER_HAS_GMPXX_H=1 <linkflags>-lgmp <linkflags>-lgmpxx ] ]
|
||||
[ run common_factor_test.cpp : : : <library>/boost/mpl//boost_mpl <library>/boost/random//boost_random <library>/boost/rational//boost_rational <library>/boost/multiprecision//boost_multiprecision [ check-target-builds has_gmpxx "Checking for gmpxx.h" : <define>BOOST_INTEGER_HAS_GMPXX_H=1 <linkflags>-lgmp <linkflags>-lgmpxx ] ]
|
||||
;
|
||||
|
187
test/integer_log2_test.cpp
Normal file
187
test/integer_log2_test.cpp
Normal file
@ -0,0 +1,187 @@
|
||||
// Boost integer_log2.hpp test program --------------------------------------//
|
||||
|
||||
// (C) Copyright Andrey Semashev 2021.
|
||||
// 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 https://www.boost.org for most recent version including documentation.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/integer/integer_log2.hpp>
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "multiprecision_config.hpp"
|
||||
|
||||
#if !defined(DISABLE_MP_TESTS)
|
||||
#include <boost/multiprecision/cpp_int.hpp>
|
||||
#endif
|
||||
|
||||
// Macros to compact code
|
||||
#define PRIVATE_LB_TEST( v, e ) BOOST_TEST( ::boost::integer_log2((v)) == e )
|
||||
|
||||
#define PRIVATE_PRINT_LB( v ) ::std::cout << "boost::integer_log2(" << (v) \
|
||||
<< ") = " << ::boost::integer_log2((v)) << '.' << ::std::endl
|
||||
|
||||
// Control to check for a compile-time error
|
||||
#ifndef CONTROL_LB_0_TEST
|
||||
#define PRIVATE_LB_0_TEST
|
||||
#else
|
||||
#define PRIVATE_LB_0_TEST PRIVATE_PRINT_LB( 0 )
|
||||
#endif
|
||||
|
||||
// Main testing function
|
||||
int main()
|
||||
{
|
||||
std::cout << "Doing tests on integer_log2." << std::endl;
|
||||
|
||||
PRIVATE_LB_0_TEST;
|
||||
|
||||
PRIVATE_LB_TEST( (unsigned char)1, 0 );
|
||||
PRIVATE_LB_TEST( (unsigned char)2, 1 );
|
||||
|
||||
PRIVATE_LB_TEST( 1, 0 );
|
||||
|
||||
PRIVATE_LB_TEST( 2, 1 );
|
||||
PRIVATE_LB_TEST( 3, 1 );
|
||||
|
||||
PRIVATE_LB_TEST( 4, 2 );
|
||||
PRIVATE_LB_TEST( 5, 2 );
|
||||
PRIVATE_LB_TEST( 6, 2 );
|
||||
PRIVATE_LB_TEST( 7, 2 );
|
||||
|
||||
PRIVATE_LB_TEST( 8, 3 );
|
||||
PRIVATE_LB_TEST( 9, 3 );
|
||||
PRIVATE_LB_TEST( 10, 3 );
|
||||
PRIVATE_LB_TEST( 11, 3 );
|
||||
PRIVATE_LB_TEST( 12, 3 );
|
||||
PRIVATE_LB_TEST( 13, 3 );
|
||||
PRIVATE_LB_TEST( 14, 3 );
|
||||
PRIVATE_LB_TEST( 15, 3 );
|
||||
|
||||
PRIVATE_LB_TEST( 16, 4 );
|
||||
PRIVATE_LB_TEST( 17, 4 );
|
||||
PRIVATE_LB_TEST( 18, 4 );
|
||||
PRIVATE_LB_TEST( 19, 4 );
|
||||
PRIVATE_LB_TEST( 20, 4 );
|
||||
PRIVATE_LB_TEST( 21, 4 );
|
||||
PRIVATE_LB_TEST( 22, 4 );
|
||||
PRIVATE_LB_TEST( 23, 4 );
|
||||
PRIVATE_LB_TEST( 24, 4 );
|
||||
PRIVATE_LB_TEST( 25, 4 );
|
||||
PRIVATE_LB_TEST( 26, 4 );
|
||||
PRIVATE_LB_TEST( 27, 4 );
|
||||
PRIVATE_LB_TEST( 28, 4 );
|
||||
PRIVATE_LB_TEST( 29, 4 );
|
||||
PRIVATE_LB_TEST( 30, 4 );
|
||||
PRIVATE_LB_TEST( 31, 4 );
|
||||
|
||||
PRIVATE_LB_TEST( 32, 5 );
|
||||
PRIVATE_LB_TEST( 33, 5 );
|
||||
PRIVATE_LB_TEST( 34, 5 );
|
||||
PRIVATE_LB_TEST( 35, 5 );
|
||||
PRIVATE_LB_TEST( 36, 5 );
|
||||
PRIVATE_LB_TEST( 37, 5 );
|
||||
PRIVATE_LB_TEST( 38, 5 );
|
||||
PRIVATE_LB_TEST( 39, 5 );
|
||||
PRIVATE_LB_TEST( 40, 5 );
|
||||
|
||||
PRIVATE_LB_TEST( 63, 5 );
|
||||
|
||||
PRIVATE_LB_TEST( 64, 6 );
|
||||
PRIVATE_LB_TEST( 65, 6 );
|
||||
|
||||
PRIVATE_LB_TEST( 127, 6 );
|
||||
|
||||
PRIVATE_LB_TEST( 128, 7 );
|
||||
PRIVATE_LB_TEST( 129, 7 );
|
||||
|
||||
PRIVATE_LB_TEST( 255, 7 );
|
||||
|
||||
PRIVATE_LB_TEST( 256, 8 );
|
||||
PRIVATE_LB_TEST( 257, 8 );
|
||||
|
||||
PRIVATE_LB_TEST( 511, 8 );
|
||||
|
||||
PRIVATE_LB_TEST( 512, 9 );
|
||||
PRIVATE_LB_TEST( 513, 9 );
|
||||
|
||||
PRIVATE_LB_TEST( 1023, 9 );
|
||||
|
||||
PRIVATE_LB_TEST( 1024, 10 );
|
||||
PRIVATE_LB_TEST( 1025, 10 );
|
||||
|
||||
PRIVATE_LB_TEST( 2047, 10 );
|
||||
|
||||
PRIVATE_LB_TEST( 2048, 11 );
|
||||
PRIVATE_LB_TEST( 2049, 11 );
|
||||
|
||||
PRIVATE_LB_TEST( 4095, 11 );
|
||||
|
||||
PRIVATE_LB_TEST( 4096, 12 );
|
||||
PRIVATE_LB_TEST( 4097, 12 );
|
||||
|
||||
PRIVATE_LB_TEST( 8191, 12 );
|
||||
|
||||
PRIVATE_LB_TEST( 8192, 13 );
|
||||
PRIVATE_LB_TEST( 8193, 13 );
|
||||
|
||||
PRIVATE_LB_TEST( 16383, 13 );
|
||||
|
||||
PRIVATE_LB_TEST( 16384, 14 );
|
||||
PRIVATE_LB_TEST( 16385, 14 );
|
||||
|
||||
PRIVATE_LB_TEST( 32767, 14 );
|
||||
|
||||
PRIVATE_LB_TEST( 32768, 15 );
|
||||
PRIVATE_LB_TEST( 32769, 15 );
|
||||
|
||||
PRIVATE_LB_TEST( 65535, 15 );
|
||||
|
||||
PRIVATE_LB_TEST( 65536, 16 );
|
||||
PRIVATE_LB_TEST( 65537, 16 );
|
||||
|
||||
#if defined(UINT32_C)
|
||||
PRIVATE_LB_TEST( UINT32_C(4294967295), 31 );
|
||||
#endif
|
||||
|
||||
#if defined(UINT64_C) && !defined(BOOST_NO_INT64_T)
|
||||
PRIVATE_LB_TEST( UINT64_C(4294967296), 32 );
|
||||
PRIVATE_LB_TEST( UINT64_C(4294967297), 32 );
|
||||
|
||||
PRIVATE_LB_TEST( UINT64_C(18446744073709551615), 63 );
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_INT128)
|
||||
PRIVATE_LB_TEST( boost::uint128_type(1u) << 64u, 64 );
|
||||
PRIVATE_LB_TEST( (boost::uint128_type(1u) << 64u) + 1u, 64 );
|
||||
|
||||
PRIVATE_LB_TEST( ~boost::uint128_type(0u), 127 );
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_MP_TESTS)
|
||||
PRIVATE_LB_TEST( boost::multiprecision::cpp_int(1), 0 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::cpp_int(2), 1 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::cpp_int(3), 1 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::cpp_int(65535), 15 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::cpp_int(65536), 16 );
|
||||
|
||||
PRIVATE_LB_TEST( boost::multiprecision::int1024_t(1), 0 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::int1024_t(2), 1 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::int1024_t(3), 1 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::int1024_t(65535), 15 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::int1024_t(65536), 16 );
|
||||
|
||||
PRIVATE_LB_TEST( boost::multiprecision::uint1024_t(1), 0 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::uint1024_t(2), 1 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::uint1024_t(3), 1 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::uint1024_t(65535), 15 );
|
||||
PRIVATE_LB_TEST( boost::multiprecision::uint1024_t(65536), 16 );
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
// Revision History
|
||||
// 23 Sep 2001 Initial version (Daryle Walker)
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#include <boost/cstdlib.hpp> // for boost::exit_success
|
||||
#include <boost/integer/integer_mask.hpp> // for boost::high_bit_mask_t, etc.
|
||||
|
@ -15,7 +15,7 @@
|
||||
// 10 Mar 01 Boost Test Library now used for tests (Beman Dawes)
|
||||
// 31 Aug 99 Initial version
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp> // for main, BOOST_TEST
|
||||
#include <boost/core/lightweight_test.hpp> // for main, BOOST_TEST
|
||||
#include <boost/integer.hpp> // for boost::int_t, boost::uint_t
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/mpl/bool.hpp> // for mpl::true_ and false_
|
||||
|
@ -17,7 +17,7 @@
|
||||
// use int64_t instead of long long for better portability
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
/*
|
||||
* General portability note:
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2018 Andrey Semashev
|
||||
// Copyright (c) 2018, 2024 Andrey Semashev
|
||||
//
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -8,25 +8,11 @@
|
||||
#define BOOST_INTEGER_TEST_MULTIPRECISION_CONFIG_HPP_INCLUDED_
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1500)) || \
|
||||
(defined(__clang_major__) && (__clang_major__ == 3) && (__clang_minor__ < 2)) || \
|
||||
(defined(BOOST_GCC) && defined(BOOST_GCC_CXX11) && BOOST_GCC < 40800)
|
||||
#define DISABLE_MP_TESTS
|
||||
#endif
|
||||
|
||||
// This list of checks matches those in Boost.Multiprecision, boost/multiprecision/detail/number_base.hpp,
|
||||
// as it no longer supports C++03 since 2021.
|
||||
#if !defined(DISABLE_MP_TESTS) && \
|
||||
(\
|
||||
defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) || defined(BOOST_NO_CXX11_HDR_ARRAY) || defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)\
|
||||
|| defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) || defined(BOOST_NO_CXX11_CONSTEXPR)\
|
||||
|| (defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) || BOOST_WORKAROUND(__SUNPRO_CC, < 0x5140)) || defined(BOOST_NO_CXX11_REF_QUALIFIERS) || defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)\
|
||||
|| defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_USER_DEFINED_LITERALS) || defined(BOOST_NO_CXX11_THREAD_LOCAL)\
|
||||
|| defined(BOOST_NO_CXX11_DECLTYPE) || defined(BOOST_NO_CXX11_STATIC_ASSERT) || defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)\
|
||||
|| defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_REF_QUALIFIERS)\
|
||||
)
|
||||
// Boost.Multiprecision requires a number of C++11 features, see boost/multiprecision/detail/check_cpp11_config.hpp.
|
||||
// Also, Boost.Multiprecision internally uses Boost.Math, which requires C++14 and a recent enough MSVC, see boost/math/tools/config.hpp.
|
||||
#if (BOOST_CXX_VERSION < 201402) || \
|
||||
(defined(_MSC_VER) && (_MSC_VER <= 1900))
|
||||
#define DISABLE_MP_TESTS
|
||||
#endif
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
// Revision History
|
||||
// 01 Oct 2001 Initial version (Daryle Walker)
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp> // for main
|
||||
#include <boost/core/lightweight_test.hpp> // for main
|
||||
|
||||
#include <boost/cstdlib.hpp> // for boost::exit_success
|
||||
#include <boost/integer/static_log2.hpp> // for boost::static_log2
|
||||
|
@ -10,7 +10,7 @@
|
||||
// Revision History
|
||||
// 23 Sep 2001 Initial version (Daryle Walker)
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp> // for main, BOOST_TEST
|
||||
#include <boost/core/lightweight_test.hpp> // for main, BOOST_TEST
|
||||
|
||||
#include <boost/cstdlib.hpp> // for boost::exit_success
|
||||
#include <boost/integer/static_min_max.hpp> // for boost::static_signed_min, etc.
|
||||
|
Reference in New Issue
Block a user