FastLED 3.10.8
Loading...
Searching...
No Matches
cerrno.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/noexcept.h"
4
5// IWYU pragma: begin_keep
6#include <errno.h>
7// IWYU pragma: end_keep // okay banned header (STL wrapper requires standard header)
8// Use C header <errno.h> instead of C++ <cerrno> for AVR platform compatibility
9
10// Bring errno functionality into fl:: namespace
11// Note: errno is a macro that expands to a thread-local lvalue.
12// Error constants (EEXIST, ENOENT, etc.) are also macros, so we access them
13// directly rather than trying to redefine them (which would cause macro expansion conflicts).
14
15namespace fl {
16
17// Inline function to get current errno value
18// Use this instead of accessing ::errno directly for cleaner code
19inline int get_errno() FL_NO_EXCEPT {
20 return errno;
21}
22
23// Inline function to set errno value
24inline void set_errno(int value) FL_NO_EXCEPT {
25 errno = value;
26}
27
28// Inline function to clear errno
30 errno = 0;
31}
32
33// Error constants are available as global macros (EEXIST, ENOENT, etc.)
34// They can be used directly: if (errno == EEXIST) { ... }
35// We provide them in the fl:: namespace for documentation purposes
36
37// Note: We do NOT redefine these as they are macros and will cause conflicts.
38// Instead, users can access them directly: EEXIST, ENOENT, etc.
39// Or use qualified access if needed, though the macros are global.
40
41} // namespace fl
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
constexpr int type_rank< T >::value
void set_errno(int value) FL_NO_EXCEPT
Definition cerrno.h:24
void clear_errno() FL_NO_EXCEPT
Definition cerrno.h:29
int get_errno() FL_NO_EXCEPT
Definition cerrno.h:19
Base definition for an LED controller.
Definition crgb.hpp:179