FastLED 3.10.8
Loading...
Searching...
No Matches
not_null.cpp.hpp
Go to the documentation of this file.
1
2// not_null.cpp - Low-level assertion implementation for fl::not_null<T>
3//
4// Provides platform-specific assertion failure handling without depending on
5// fl/stl/assert.h (which might depend on not_null in the future, creating
6// circular dependencies).
7//
8// Platform-specific behavior matches the expectations documented in not_null.h:
9// - Desktop/Host: stderr output + abort()
10// - ESP32: Serial output via fl::println() + abort()
11// - WASM: Browser console warning + debugger breakpoint
12// - AVR: Minimal output due to memory constraints + abort()
14
15#include "fl/stl/not_null.h"
16#include "fl/stl/assert.h"
17
18namespace fl {
19namespace detail {
20
21// Low-level assertion failure handler for not_null
22// Called when a nullptr is detected during construction or assignment
23// Platform-specific implementation to avoid circular dependencies
24void not_null_assert_failed(const char* message) FL_NO_EXCEPT {
25 FL_UNUSED(message); // FL_ASSERT compiles to nothing in some builds
26 FL_ASSERT(false, message);
27}
28
29} // namespace detail
30} // namespace fl
#define FL_ASSERT(x, MSG)
Definition assert.h:6
#define FL_UNUSED(x)
void not_null_assert_failed(const char *message) FL_NO_EXCEPT
Compile-time linker keep-alive hook for a single fl::Bus.
Definition bus_info.h:57
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
Base definition for an LED controller.
Definition crgb.hpp:179