Skip to content

Commit

Permalink
Repair QEMU job in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Nov 24, 2024
1 parent 26704b6 commit 9e1dd98
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions examples/example008_bernoulli_tgamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,43 +382,40 @@ auto ::math::wide_decimal::example008_bernoulli_tgamma() -> bool
// Enable this if you would like to activate this main() as a standalone example.
#if defined(WIDE_DECIMAL_STANDALONE_EXAMPLE008_BERNOULLI_TGAMMA)

constexpr auto app_benchmark_standalone_foodcafe = static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE));
constexpr auto example_standalone_foodcafe = static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE));

extern "C"
{
extern volatile std::uint32_t app_benchmark_standalone_result; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
extern volatile std::uint32_t example_standalone_result; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)

auto app_benchmark_run_standalone (void) -> bool;
auto app_benchmark_get_standalone_result(void) -> bool;
auto example_run_standalone() -> bool;
auto example_get_standalone_result() noexcept -> bool;

auto app_benchmark_run_standalone(void) -> bool
auto example_run_standalone() -> bool
{
const auto result_is_ok = ::math::wide_decimal::example008_bernoulli_tgamma();

app_benchmark_standalone_result =
example_standalone_result =
static_cast<std::uint32_t>
(
result_is_ok ? app_benchmark_standalone_foodcafe : static_cast<std::uint32_t>(UINT32_C(0xFFFFFFFF))
result_is_ok ? example_standalone_foodcafe : static_cast<std::uint32_t>(UINT32_C(0xFFFFFFFF))
);

return result_is_ok;
}

auto app_benchmark_get_standalone_result(void) -> bool
auto example_get_standalone_result() noexcept -> bool
{
volatile auto result_is_ok =
(app_benchmark_standalone_result == static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE)));

return result_is_ok;
return { example_standalone_result == static_cast<std::uint32_t>(UINT32_C(0xF00DCAFE)) };
}
}

auto main() -> int
{
auto result_is_ok = true;
bool result_is_ok { true };

result_is_ok = (::app_benchmark_run_standalone () && result_is_ok);
result_is_ok = (::app_benchmark_get_standalone_result() && result_is_ok);
result_is_ok = (::example_run_standalone () && result_is_ok);
result_is_ok = (::example_get_standalone_result() && result_is_ok);

#if !defined(WIDE_DECIMAL_DISABLE_IOSTREAM)
std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
Expand All @@ -429,7 +426,7 @@ auto main() -> int

extern "C"
{
volatile std::uint32_t app_benchmark_standalone_result; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
volatile std::uint32_t example_standalone_result; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
}

#endif
Expand Down

0 comments on commit 9e1dd98

Please sign in to comment.