Skip to content

Commit

Permalink
Revert if constepr macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinitou committed Jan 19, 2024
1 parent aa26d48 commit e61cad1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/clap/helpers/host.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,15 @@ namespace clap { namespace helpers {
///////////////
template <MisbehaviourHandler h, CheckingLevel l>
Host<h, l> &Host<h, l>::from(const clap_host *host) noexcept {
CLAP_IF_CONSTEXPR (l >= CheckingLevel::Minimal) {
if constexpr (l >= CheckingLevel::Minimal) {
if (!host) CLAP_HELPERS_UNLIKELY {
std::cerr << "Passed an null host pointer" << std::endl;
std::terminate();
}
}

auto self = static_cast<Host *>(host->host_data);
CLAP_IF_CONSTEXPR (l >= CheckingLevel::Minimal) {
if constexpr (l >= CheckingLevel::Minimal) {
if (!self) CLAP_HELPERS_UNLIKELY {
std::cerr << "Passed an invalid host pointer because the host_data is null"
<< std::endl;
Expand Down
6 changes: 0 additions & 6 deletions include/clap/helpers/macros.hh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#pragma once

#if defined(__cplusplus) && __cplusplus >= 201703L
# define CLAP_IF_CONSTEXPR if constexpr
#else
# define CLAP_IF_CONSTEXPR if
#endif

#if defined(__cplusplus) && __cplusplus >= 202002L
# define CLAP_HELPERS_UNLIKELY [[unlikely]]
#else
Expand Down

0 comments on commit e61cad1

Please sign in to comment.