Age | Commit message (Collapse) | Author |
|
|
|
|
|
ISO C requires in section 7.2:
The assert macro is redefined according to the current state of NDEBUG
each time that <assert.h> is included.
Also add tests for `assert` multiple inclusion accordingly.
|
|
It should be now the only user of it, and it is more logical to have it
in `stdlib.h` than in `assert.h`
|
|
Both `AK/Assertions.h` and `assert.h` would define the macro if `NDEBUG`
is set.
Remove the definition from `assert.h` since it is not an ISO-C
requirement.
|
|
|
|
It's a single expression, no do/while needed. This makes assert() work
with the comma operator (assert(foo), assert(bar), assert(baz)).
Found because exactly this is being used somewhere in the guts of LLVM.
|
|
The C standard doesn't say anything about DEBUG, just NDEBUG :^)
|
|
Fixes errors when building Clang's compiler-rt, which compiles in C11
more.
|
|
Other software might not expect these to be defined and behave
differently if they _are_ defined, e.g. scummvm which checks if
the TODO macro is defined and fails to build if it is.
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
This also brings LibC's abort() function closer to the spec.
|
|
This way CRASH() can be used in functions that are themselves
marked as noreturn.
|
|
|
|
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
|