Skip to content

Commit 45b7976

Browse files
authored
Merge pull request #953 from cppalliance/develop
Merge to Master for v5.0.0
2 parents 7f25e1d + 4076251 commit 45b7976

File tree

342 files changed

+16558
-13838
lines changed

Some content is hidden

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

342 files changed

+16558
-13838
lines changed

.drone.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
194194
linux_pipeline(
195195
"Linux 22.04 GCC 12 64 ASAN",
196196
"cppalliance/droneubuntu2204:1",
197-
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + asan,
197+
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '14,20', ADDRMD: '64' } + asan,
198198
"g++-12-multilib",
199199
),
200200

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ jobs:
7878
- g++-11-multilib
7979
- toolset: gcc-12
8080
cxxstd: "03,11,14,17,20,23"
81-
address_model: 32,64
81+
address_model: 64
82+
os: ubuntu-latest
83+
container: ubuntu:22.04
84+
install:
85+
- g++-12-multilib
86+
- toolset: gcc-12
87+
cxxstd: "03,11,14,17,20,23"
88+
address_model: 32
8289
os: ubuntu-latest
8390
container: ubuntu:22.04
8491
install:

.github/workflows/metal.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------
2-
# Copyright Matt Borland 2023 - 2024.
3-
# Copyright Christopher Kormanyos 2023 - 2024.
2+
# Copyright Matt Borland 2023 - 2025.
3+
# Copyright Christopher Kormanyos 2023 - 2025.
44
# Distributed under the Boost Software License,
55
# Version 1.0. (See accompanying file LICENSE_1_0.txt
66
# or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -33,20 +33,20 @@ jobs:
3333
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncursesw5_6.3-2ubuntu0.1_amd64.deb
3434
sudo apt install ./libncursesw5_6.3-2ubuntu0.1_amd64.deb
3535
mkdir -p emu_env && cd emu_env
36-
wget --no-check-certificate https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
37-
tar -xf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
36+
wget --no-check-certificate https://developer.arm.com/-/media/Files/downloads/gnu/14.3.rel1/binrel/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi.tar.xz
37+
tar -xf arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi.tar.xz
3838
wget --no-check-certificate https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v8.2.6-1/xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz
3939
tar -xzf xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz
4040
working-directory: ./test/metal/
4141
- name: build benchmark_single-stm32f429
4242
run: |
43-
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
43+
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
4444
echo 'Query arm-none-eabi-g++ version'
4545
echo
4646
arm-none-eabi-g++ -v
4747
echo
4848
mkdir -p bin
49-
arm-none-eabi-g++ -std=c++20 -Wall -Wextra -Wpedantic -Os -g -gdwarf-2 -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -fno-inline-functions -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf
49+
arm-none-eabi-g++ -std=c++23 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wunused-parameter -Wuninitialized -Wshadow -Os -g -gdwarf-2 -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -fno-inline-functions -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf
5050
arm-none-eabi-objcopy ./bin/app_benchmark_non_std_decimal.elf -O ihex ./bin/app_benchmark_non_std_decimal.hex
5151
ls -la ./bin/app_benchmark_non_std_decimal.elf ./bin/app_benchmark_non_std_decimal.hex ./bin/app_benchmark_non_std_decimal.map
5252
working-directory: ./test/metal/
@@ -59,7 +59,7 @@ jobs:
5959
- name: run-test-on-target
6060
run: |
6161
sleep 2
62-
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
62+
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/arm-gnu-toolchain-14.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
6363
echo 'Run test on target'
6464
echo
6565
arm-none-eabi-gdb ./bin/app_benchmark_non_std_decimal.elf -x ./target/build/test_app_benchmarks_emulator.gdb > ./app_benchmark_non_std_decimal.txt

.github/workflows/qemu.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ jobs:
4242
# multiarch testing
4343
- { name: PPC64LE-GCC, multiarch: yes,
4444
compiler: gcc, cxxstd: '14', os: ubuntu-22.04, ccache: no, distro: alpine, edition: edge, arch: ppc64le }
45-
- { name: PPC64LE-Clang, multiarch: yes,
46-
compiler: clang, cxxstd: '14', os: ubuntu-22.04, ccache: no, distro: alpine, edition: edge, arch: ppc64le }
47-
4845

4946
timeout-minutes: 360
5047
runs-on: ${{matrix.os}}

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| Github Actions | [![CI](https://github.com/cppalliance/decimal/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/cppalliance/decimal/actions/workflows/ci.yml) | [![CI](https://github.com/cppalliance/decimal/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/cppalliance/decimal/actions/workflows/ci.yml)
77
| Codecov | [![codecov](https://codecov.io/gh/cppalliance/decimal/branch/master/graph/badge.svg?token=drvY8nnV5S)](https://codecov.io/gh/cppalliance/decimal) | [![codecov](https://codecov.io/gh/cppalliance/decimal/graph/badge.svg?token=drvY8nnV5S)](https://codecov.io/gh/cppalliance/decimal) |
88
| Fuzzing | [![Fuzzing](https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml/badge.svg?branch=master)](https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml) | [![Fuzzing](https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml/badge.svg?branch=develop)](https://github.com/cppalliance/decimal/actions/workflows/fuzz.yml) |
9+
| Metal | [![Metal](https://github.com/cppalliance/decimal/actions/workflows/metal.yml/badge.svg?branch=master)](https://github.com/cppalliance/decimal/actions/workflows/metal.yml) | [![Metal](https://github.com/cppalliance/decimal/actions/workflows/metal.yml/badge.svg?branch=develop)](https://github.com/cppalliance/decimal/actions/workflows/metal.yml) |
910

1011
---
1112

@@ -51,12 +52,12 @@ conan create decimal/conan --build missing
5152

5253
# Supported Platforms
5354

54-
Boost.Decimal is tested natively on Ubuntu (x86_64, s390x, and aarch64), macOS (x86_64, and Apple Silicon), and Windows (x32 and x64);
55-
as well as emulated PPC64LE and STM32 using QEMU with the following compilers:
55+
Boost.Decimal is tested natively on Ubuntu (x86_64, s390x, and aarch64), macOS (x86_64, and Apple Silicon),
56+
and Windows (x32 and x64); as well as emulated PPC64LE and ARM Cortex-M using QEMU with the following compilers:
5657

5758
* GCC 7 and later
5859
* Clang 6 and later
59-
* Visual Studio 2017 and later
60+
* Visual Studio 2019 and later
6061
* Intel OneAPI DPC++
6162

6263
# Synopsis
@@ -67,9 +68,9 @@ Decimal provides 3 IEEE-754 compliant types:
6768
namespace boost {
6869
namespace decimal {
6970

70-
class decimal32;
71-
class decimal64;
72-
class decimal128;
71+
class decimal32_t;
72+
class decimal64_t;
73+
class decimal128_t;
7374

7475
} //namespace decimal
7576
} //namespace boost
@@ -81,9 +82,9 @@ and also 3 similar but non-compliant types with improved runtime performance:
8182
namespace boost {
8283
namespace decimal {
8384
84-
class decimal32_fast;
85-
class decimal64_fast;
86-
class decimal128_fast;
85+
class decimal_fast32_t;
86+
class decimal_fast64_t;
87+
class decimal_fast128_t;
8788
8889
} //namespace decimal
8990
} //namespace boost
@@ -103,10 +104,10 @@ Using the decimal types is simple.
103104

104105
int main()
105106
{
106-
using boost::decimal::decimal32;
107+
using boost::decimal::decimal32_t;
107108

108-
constexpr decimal32 a {2, -1}; // Constructs the number 0.2
109-
constexpr decimal32 b {1, -1}; // Constructs the number 0.1
109+
constexpr decimal32_t a {2, -1}; // Constructs the number 0.2
110+
constexpr decimal32_t b {1, -1}; // Constructs the number 0.1
110111
auto sum {a + b};
111112

112113
std::cout << sum << std::endl; // prints 0.3
@@ -122,7 +123,7 @@ int main()
122123
```
123124

124125
This intuitive straightforwardness is the same when using Standard-Library
125-
functions (such as STL functions, `<cmath>`-like functions and the like).
126+
functions (such as STL functions, `<cmath>` functions and the like).
126127

127128
```cpp
128129
#include <boost/decimal.hpp>
@@ -133,15 +134,15 @@ int main()
133134
{
134135
using namespace boost::decimal;
135136

136-
decimal64 val {-0.25}; // Construction from a double
137+
decimal64_t val {-0.25}; // Construction from a double
137138
val = abs(val); // DO NOT call std::abs
138139

139140
char buffer[256];
140141
auto r_to = to_chars(buffer, buffer + sizeof(buffer) - 1, val);
141142
assert(r_to); // checks std::errc()
142143
*r_to.ptr = '\0';
143144

144-
decimal64 return_value;
145+
decimal64_t return_value;
145146
auto r_from = from_chars(buffer, buffer + std::strlen(buffer), return_value);
146147

147148
assert(val == return_value);

doc/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/pdf/
22
/html/
3+
/build/
4+
/node_modules/

doc/Jamfile

Lines changed: 0 additions & 25 deletions
This file was deleted.

doc/Jamfile.v2

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import generate ;
2+
import path ;
3+
import property-set ;
4+
import virtual-target ;
5+
6+
path-constant HERE : . ;
7+
8+
make html/index.html : build_antora.sh : @run-script ;
9+
generate files-to-install : html/index.html : <generating-rule>@delayed-glob ;
10+
install install
11+
: files-to-install
12+
: <location>html
13+
<install-source-root>html/decimal
14+
;
15+
explicit html/index.html files-to-install ;
16+
17+
# this runs the antora script
18+
actions run-script
19+
{
20+
bash $(>)
21+
}
22+
23+
# this globs after its sources are created
24+
rule delayed-glob ( project name : property-set : sources * )
25+
{
26+
for local src in $(sources)
27+
{
28+
# the next line causes the source to be generated immediately
29+
# and not later (which it normally would)
30+
UPDATE_NOW [ $(src).actualize ] ;
31+
}
32+
33+
# we need to construct the path to the globbed directory;
34+
# this path would be <current-project>/antora
35+
local root = [ path.root html [ $(project).location ] ] ;
36+
local files ;
37+
38+
# actual globbing happens here
39+
for local file in [ path.glob-tree $(root) : * ]
40+
{
41+
# we have to skip directories, because our match expression accepts anything
42+
if [ CHECK_IF_FILE $(file) ]
43+
{
44+
# we construct a list of targets to copy
45+
files += [ virtual-target.from-file $(file:D=) : $(file:D) : $(project) ] ;
46+
}
47+
}
48+
49+
# we prepend empty usage requirements to the result
50+
return [ property-set.empty ] $(files) ;
51+
}
52+
53+
###############################################################################
54+
alias boostdoc ;
55+
explicit boostdoc ;
56+
alias boostrelease : install ;
57+
explicit boostrelease ;

doc/antora.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: decimal
2+
version: ~
3+
title: Boost.Decimal
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
start_page: overview.adoc

doc/antora_docs.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6+
cd "$SCRIPT_DIR"
7+
8+
npm ci
9+
npx antora decimal-playbook.yml

0 commit comments

Comments
 (0)