Skip to content

Commit 2fb5c6d

Browse files
authored
Merge pull request #381 from cppalliance/develop
Merge to master for v2.0.0
2 parents 4bfa2d4 + 9fe1749 commit 2fb5c6d

150 files changed

Lines changed: 11285 additions & 1164 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.drone.jsonnet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,4 +416,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
416416
"cppalliance/dronevs2022:1",
417417
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest', ADDRMD: '32,64' },
418418
),
419+
420+
windows_pipeline(
421+
"Windows VS2026 msvc-14.5",
422+
"cppalliance/dronevs2026:1",
423+
{ TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest', ADDRMD: '32,64' },
424+
),
419425
]

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2025 Matt Borland
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
4+
5+
version: 2
6+
updates:
7+
- package-ecosystem: "npm"
8+
directory: "/doc"
9+
schedule:
10+
interval: "weekly"
11+
groups:
12+
all-dependencies:
13+
# Groups all updates into a single PR
14+
patterns:
15+
- "*"

.github/workflows/ci.yml

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,12 @@ jobs:
298298
source_keys:
299299
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
300300

301-
- toolset: clang
302-
cxxstd: "03,11,14,17,20,2b"
303-
os: macos-14
304301
- toolset: clang
305302
cxxstd: "03,11,14,17,20,2b"
306303
os: macos-15
304+
- toolset: clang
305+
cxxstd: "03,11,14,17,20,2b,2c"
306+
os: macos-26
307307

308308
timeout-minutes: 180
309309
runs-on: ${{matrix.os}}
@@ -620,8 +620,8 @@ jobs:
620620
include:
621621
- os: ubuntu-22.04
622622
- os: ubuntu-24.04
623-
- os: macos-14
624623
- os: macos-15
624+
- os: macos-26
625625

626626
runs-on: ${{matrix.os}}
627627

@@ -666,8 +666,8 @@ jobs:
666666
fail-fast: false
667667
matrix:
668668
include:
669-
- os: macos-14
670669
- os: macos-15
670+
- os: macos-26
671671

672672
runs-on: ${{matrix.os}}
673673

@@ -724,8 +724,8 @@ jobs:
724724
include:
725725
- os: ubuntu-22.04
726726
- os: ubuntu-24.04
727-
- os: macos-14
728727
- os: macos-15
728+
- os: macos-26
729729

730730
runs-on: ${{matrix.os}}
731731

@@ -780,8 +780,8 @@ jobs:
780780
include:
781781
- os: ubuntu-22.04
782782
- os: ubuntu-24.04
783-
- os: macos-14
784783
- os: macos-15
784+
- os: macos-26
785785

786786
runs-on: ${{matrix.os}}
787787

@@ -952,8 +952,8 @@ jobs:
952952
matrix:
953953
include:
954954
- os: ubuntu-24.04
955-
- os: macos-14
956955
- os: macos-15
956+
- os: macos-26
957957

958958
runs-on: ${{matrix.os}}
959959

@@ -1146,3 +1146,60 @@ jobs:
11461146
cd ~/pkgconfig_test
11471147
g++ main.cpp $(pkg-config --cflags --libs boost_int128) -o test_pkgconfig
11481148
./test_pkgconfig
1149+
1150+
cuda-cmake-test:
1151+
strategy:
1152+
fail-fast: false
1153+
1154+
runs-on: gpu-runner-1
1155+
1156+
steps:
1157+
- uses: Jimver/cuda-toolkit@v0.2.30
1158+
id: cuda-toolkit
1159+
with:
1160+
cuda: '12.8.0'
1161+
method: 'network'
1162+
sub-packages: '["nvcc"]'
1163+
1164+
- name: Output CUDA information
1165+
run: |
1166+
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"+
1167+
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
1168+
nvcc -V
1169+
- uses: actions/checkout@v5
1170+
1171+
- name: Install Packages
1172+
run: |
1173+
sudo apt-get install -y cmake make
1174+
- name: Setup Boost
1175+
run: |
1176+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
1177+
LIBRARY=${GITHUB_REPOSITORY#*/}
1178+
echo LIBRARY: $LIBRARY
1179+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
1180+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
1181+
echo GITHUB_REF: $GITHUB_REF
1182+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
1183+
REF=${REF#refs/heads/}
1184+
echo REF: $REF
1185+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
1186+
echo BOOST_BRANCH: $BOOST_BRANCH
1187+
cd ..
1188+
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
1189+
cd boost-root
1190+
mkdir -p libs/$LIBRARY
1191+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
1192+
git submodule update --init tools/boostdep
1193+
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
1194+
- name: Test C++17/20/23
1195+
run: |
1196+
for std in 17 20 23; do
1197+
echo "======== Testing C++${std} ========"
1198+
cd ../boost-root
1199+
rm -rf __build__
1200+
mkdir __build__ && cd __build__
1201+
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DBOOST_INT128_ENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75;86" -DCMAKE_CUDA_STANDARD=${std} ..
1202+
cmake --build . --target tests -j $(nproc)
1203+
ctest --output-on-failure --no-tests=error
1204+
cd $GITHUB_WORKSPACE
1205+
done

.github/workflows/codecov.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,21 @@ jobs:
8080
fi
8181
git config --global pack.threads 0
8282
83-
- uses: actions/checkout@v3
83+
- uses: actions/checkout@v4
8484
with:
8585
# For coverage builds fetch the whole history, else only 1 commit using a 'fake ternary'
8686
fetch-depth: ${{ matrix.coverage && '0' || '1' }}
8787

8888
- name: Cache ccache
89-
uses: actions/cache@v3
89+
uses: actions/cache@v4
9090
if: env.B2_USE_CCACHE
9191
with:
9292
path: ~/.ccache
9393
key: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-${{github.sha}}
9494
restore-keys: ${{matrix.os}}-${{matrix.container}}-${{matrix.compiler}}-
9595

9696
- name: Fetch Boost.CI
97-
uses: actions/checkout@v3
97+
uses: actions/checkout@v4
9898
with:
9999
repository: boostorg/boost-ci
100100
ref: master

.github/workflows/fuzz.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,22 @@ jobs:
4141
echo 'compiling test/fuzzing/test_fuzzing_div_versus_wide_int.cpp'
4242
${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I./include -I${{runner.workspace}}/wide-integer test/fuzzing/test_fuzzing_div_versus_wide_int.cpp -o test_fuzzing_div_versus_wide_int
4343
echo "run test_fuzzing_div_versus_wide_int"
44-
./test_fuzzing_div_versus_wide_int -max_total_time=900 -max_len=32 -verbosity=0 -close_fd_mask=3
44+
./test_fuzzing_div_versus_wide_int -max_total_time=600 -max_len=32 -verbosity=0 -close_fd_mask=3
45+
46+
echo 'compiling test/fuzzing/test_fuzzing_add_versus_wide_int.cpp'
47+
${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I./include -I${{runner.workspace}}/wide-integer test/fuzzing/test_fuzzing_add_versus_wide_int.cpp -o test_fuzzing_add_versus_wide_int
48+
echo "run test_fuzzing_add_versus_wide_int"
49+
./test_fuzzing_add_versus_wide_int -max_total_time=300 -max_len=32 -verbosity=0 -close_fd_mask=3
50+
51+
echo 'compiling test/fuzzing/test_fuzzing_sub_versus_wide_int.cpp'
52+
${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I./include -I${{runner.workspace}}/wide-integer test/fuzzing/test_fuzzing_sub_versus_wide_int.cpp -o test_fuzzing_sub_versus_wide_int
53+
echo "run test_fuzzing_sub_versus_wide_int"
54+
./test_fuzzing_sub_versus_wide_int -max_total_time=300 -max_len=32 -verbosity=0 -close_fd_mask=3
55+
56+
echo 'compiling test/fuzzing/test_fuzzing_mul_versus_wide_int.cpp'
57+
${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I./include -I${{runner.workspace}}/wide-integer test/fuzzing/test_fuzzing_mul_versus_wide_int.cpp -o test_fuzzing_mul_versus_wide_int
58+
echo "run test_fuzzing_mul_versus_wide_int"
59+
./test_fuzzing_mul_versus_wide_int -max_total_time=300 -max_len=32 -verbosity=0 -close_fd_mask=3
4560
4661
clang-fuzzing-versus-wide-integer-no-builtin:
4762
runs-on: ubuntu-latest
@@ -68,4 +83,19 @@ jobs:
6883
echo 'compiling test/fuzzing/test_fuzzing_div_versus_wide_int.cpp'
6984
${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I./include -I${{runner.workspace}}/wide-integer -DBOOST_INT128_NO_BUILTIN_INT128=1 test/fuzzing/test_fuzzing_div_versus_wide_int.cpp -o test_fuzzing_div_versus_wide_int
7085
echo "run test_fuzzing_div_versus_wide_int"
71-
./test_fuzzing_div_versus_wide_int -max_total_time=900 -max_len=32 -verbosity=0 -close_fd_mask=3
86+
./test_fuzzing_div_versus_wide_int -max_total_time=600 -max_len=32 -verbosity=0 -close_fd_mask=3
87+
88+
echo 'compiling test/fuzzing/test_fuzzing_add_versus_wide_int.cpp'
89+
${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I./include -I${{runner.workspace}}/wide-integer -DBOOST_INT128_NO_BUILTIN_INT128=1 test/fuzzing/test_fuzzing_add_versus_wide_int.cpp -o test_fuzzing_add_versus_wide_int
90+
echo "run test_fuzzing_add_versus_wide_int"
91+
./test_fuzzing_add_versus_wide_int -max_total_time=300 -max_len=32 -verbosity=0 -close_fd_mask=3
92+
93+
echo 'compiling test/fuzzing/test_fuzzing_sub_versus_wide_int.cpp'
94+
${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I./include -I${{runner.workspace}}/wide-integer -DBOOST_INT128_NO_BUILTIN_INT128=1 test/fuzzing/test_fuzzing_sub_versus_wide_int.cpp -o test_fuzzing_sub_versus_wide_int
95+
echo "run test_fuzzing_sub_versus_wide_int"
96+
./test_fuzzing_sub_versus_wide_int -max_total_time=300 -max_len=32 -verbosity=0 -close_fd_mask=3
97+
98+
echo 'compiling test/fuzzing/test_fuzzing_mul_versus_wide_int.cpp'
99+
${{ matrix.compiler }} -std=c++20 -g -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=fuzzer -I./include -I${{runner.workspace}}/wide-integer -DBOOST_INT128_NO_BUILTIN_INT128=1 test/fuzzing/test_fuzzing_mul_versus_wide_int.cpp -o test_fuzzing_mul_versus_wide_int
100+
echo "run test_fuzzing_mul_versus_wide_int"
101+
./test_fuzzing_mul_versus_wide_int -max_total_time=300 -max_len=32 -verbosity=0 -close_fd_mask=3

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ int128 is under active development and is not an official boost library.
1616

1717
This library is header only. It contains no other dependencies.
1818
Simply `#include` it and use it.
19+
With C++20 and greater you can instead `import boost.int128`.
1920

2021
## CMake
2122

@@ -64,13 +65,13 @@ struct int128_t;
6465
6566
These types operate like built-in integer types.
6667
They have their own implementations of the Standard-Library functions
67-
(e.g. like those found in `<limits>`, `<iostream>`, `<bit>` etc.).
68+
(e.g., like those found in `<limits>`, `<iostream>`, `<bit>` etc.).
6869
6970
The entire library can be conveniently included with `#include <boost/int128.hpp>`
7071
7172
# Full Documentation
7273
73-
The complete documentation can be found at: https://master.int128.cpp.al
74+
The complete documentation can be found at: https://develop.int128.cpp.al
7475
7576
## References
7677

doc/antora.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: ROOT
22
version: ~
33
title: Boost.int128
4+
asciidoc:
5+
attributes:
6+
page-pagination: ''
47
nav:
58
- modules/ROOT/nav.adoc
69
start_page: overview.adoc

doc/int128-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ content:
55
sources:
66
- url: ..
77
start_path: doc
8-
branches: HEAD
8+
branches: develop
99
output:
1010
dir: html
1111
ui:

doc/modules/ROOT/nav.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
** xref:examples.adoc#examples_rollover[Rollover Behavior]
77
** xref:examples.adoc#examples_bit[`<bit>` support]
88
** xref:examples.adoc#examples_numeric[`<numeric>` support (Saturating Arithmetic)]
9-
** xref:examples.adoc#examples_numeric[`<numeric>` support (Numeric Logarithms)]
9+
** xref:examples.adoc#examples_numeric_algorithms[`<numeric>` support (Numeric Algorithms)]
1010
** xref:examples.adoc#examples_mixed_sign[Mixed Signedness Arithmetic]
1111
** xref:examples.adoc#examples_to_string[String Conversion (to_string)]
1212
** xref:examples.adoc#examples_boost_math_random[Boost Math and Random Integration]
1313
** xref:examples.adoc#examples_boost_charconv[Boost.Charconv Integration]
1414
** xref:examples.adoc#examples_cstdlib[`<cstdlib>` support (Combined div and mod)]
15+
** xref:examples.adoc#examples_cuda[Use of the library in a CUDA kernel]
1516
* xref:api_reference.adoc[]
1617
** xref:api_reference.adoc#api_namespaces[Namespaces]
1718
** xref:api_reference.adoc#api_types[Types]
@@ -29,6 +30,7 @@
2930
** xref:api_reference.adoc#api_macros[Macros]
3031
*** xref:api_reference.adoc#api_macro_literals[Literals]
3132
*** xref:api_reference.adoc#api_macro_configuration[Configuration]
33+
** xref:api_reference.adoc#api_headers[Headers]
3234
* xref:uint128_t.adoc[]
3335
** xref:uint128_t.adoc#u128_alignment[Alignment]
3436
** xref:uint128_t.adoc#u128_operator_behavior[Operator Behavior]

doc/modules/ROOT/pages/api_reference.adoc

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ https://www.boost.org/LICENSE_1_0.txt
2020

2121
| xref:literals.adoc[`boost::int128::literals`]
2222
| User-defined literals for 128-bit integers
23+
24+
| xref:charconv.adoc[`boost::charconv`]
25+
| `to_chars` and `from_chars` overloads for 128-bit integers (requires Boost.Charconv)
2326
|===
2427

2528
[#api_types]
@@ -146,7 +149,7 @@ Listed by analogous STL header.
146149
|===
147150
| Function | Description
148151

149-
| `abs`
152+
| xref:int128_t.adoc#i128_math_operators[`abs`]
150153
| Absolute value
151154
|===
152155

@@ -307,6 +310,9 @@ Listed by analogous STL header.
307310

308311
| xref:config.adoc#disable_exceptions[`BOOST_INT128_DISABLE_EXCEPTIONS`]
309312
| Disables exception throwing
313+
314+
| xref:config.adoc#enable_cuda[`BOOST_INT128_ENABLE_CUDA`]
315+
| Enables CUDA support allowing the library types and functions to be run on both host and device
310316
|===
311317

312318
==== Automatic Configuration
@@ -323,4 +329,58 @@ Listed by analogous STL header.
323329

324330
| xref:config.adoc#automatic_config[`BOOST_INT128_ENDIAN_BIG_BYTE`]
325331
| Defined on big-endian systems
326-
|===
332+
333+
| xref:config.adoc#host_device[`BOOST_INT128_HOST_DEVICE`]
334+
| Expands to `pass:[__host__ __device__]` under NVCC for CUDA support
335+
|===
336+
337+
[#api_headers]
338+
== Headers
339+
340+
[cols="1,2", options="header"]
341+
|===
342+
| Header | Contents
343+
344+
| `<boost/int128.hpp>`
345+
| Convenience header including the entire library
346+
347+
| xref:bit.adoc[`<boost/int128/bit.hpp>`]
348+
| Bit manipulation functions
349+
350+
| xref:charconv.adoc[`<boost/int128/charconv.hpp>`]
351+
| Character conversion functions
352+
353+
| `<boost/int128/climits.hpp>`
354+
| Min and max macros
355+
356+
| xref:cstdlib.adoc[`<boost/int128/cstdlib.hpp>`]
357+
| Combined division and modulo function
358+
359+
| xref:format.adoc#fmt_format[`<boost/int128/fmt_format.hpp>`]
360+
| Formatting integration for pass:[{fmt}]
361+
362+
| xref:format.adoc#std_format[`<boost/int128/format.hpp>`]
363+
| Formatting integration for pass:[C++20] `<format>`
364+
365+
| `<boost/int128/int128.hpp>`
366+
| The xref:uint128_t.adoc[`uint128_t`] and xref:int128_t.adoc[`int128_t`] types
367+
368+
| xref:stream.adoc[`<boost/int128/iostream.hpp>`]
369+
| Iostream overloads for `int128_t` and `uint128_t`
370+
371+
| `<boost/int128/limits.hpp>`
372+
| Overloads for `std::numeric_limits` for `int128_t` and `uint128_t`
373+
374+
| xref:literals.adoc[`<boost/int128/literals.hpp>`]
375+
| User-defined literals for `int128_t` and `uint128_t`
376+
377+
| xref:numeric.adoc[`<boost/int128/numeric.hpp>`]
378+
| Numeric algorithms (gcd, lcm, midpoint)
379+
380+
| xref:string.adoc[`<boost/int128/string.hpp>`]
381+
| `to_string` overloads
382+
383+
| `<boost/int128/random.hpp>`
384+
| Required for usage of Boost.Random
385+
386+
|===

0 commit comments

Comments
 (0)