mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
AK: Rename {DBGLN_NO => ENABLE}_COMPILETIME_FORMAT_CHECK
This is no longer limited to dbgln(). Also invert it to match all the other ENABLE_FOO options.
This commit is contained in:
parent
857cdee0d0
commit
6ad3454bfb
2 changed files with 15 additions and 14 deletions
|
@ -31,15 +31,15 @@
|
|||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
#ifndef DBGLN_NO_COMPILETIME_FORMAT_CHECK
|
||||
#ifdef ENABLE_COMPILETIME_FORMAT_CHECK
|
||||
// FIXME: Seems like clang doesn't like calling 'consteval' functions inside 'consteval' functions quite the same way as GCC does,
|
||||
// it seems to entirely forget that it accepted that parameters to a 'consteval' function to begin with.
|
||||
# ifdef __clang__
|
||||
# define DBGLN_NO_COMPILETIME_FORMAT_CHECK
|
||||
# undef ENABLE_COMPILETIME_FORMAT_CHECK
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DBGLN_NO_COMPILETIME_FORMAT_CHECK
|
||||
#ifdef ENABLE_COMPILETIME_FORMAT_CHECK
|
||||
namespace AK::Format::Detail {
|
||||
|
||||
// We have to define a local "purely constexpr" Array that doesn't lead back to us (via e.g. VERIFY)
|
||||
|
@ -163,7 +163,7 @@ struct CheckedFormatString {
|
|||
consteval CheckedFormatString(const char (&fmt)[N])
|
||||
: m_string { fmt }
|
||||
{
|
||||
#ifndef DBGLN_NO_COMPILETIME_FORMAT_CHECK
|
||||
#ifdef ENABLE_COMPILETIME_FORMAT_CHECK
|
||||
check_format_parameter_consistency<N, sizeof...(Args)>(fmt);
|
||||
#endif
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ struct CheckedFormatString {
|
|||
auto view() const { return m_string; }
|
||||
|
||||
private:
|
||||
#ifndef DBGLN_NO_COMPILETIME_FORMAT_CHECK
|
||||
#ifdef ENABLE_COMPILETIME_FORMAT_CHECK
|
||||
template<size_t N, size_t param_count>
|
||||
consteval static bool check_format_parameter_consistency(const char (&fmt)[N])
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue