23 #ifndef LEGATO_BASICS_INCLUDE_GUARD 24 #define LEGATO_BASICS_INCLUDE_GUARD 32 #ifdef __ARMCC_VERSION 86 #define EXIT_UNAVAILABLE 69 132 #define CONTAINER_OF(memberPtr, type, member) \ 133 ((type*)(((uint8_t*)(memberPtr))-((size_t)(&(((type*)0)->member))))) 166 #define NUM_ARRAY_MEMBERS(array) \ 167 (sizeof(array) / sizeof((array)[0])) 193 #define INDEX_OF_ARRAY_MEMBER(array, memberPtr) \ 194 ((((size_t)memberPtr) - ((size_t)array)) / sizeof(*(memberPtr))) 231 #define STRINGIZE(x) STRINGIZE_EXPAND(x) 238 #define STRINGIZE_EXPAND(x) #x // Needed to expand macros. 248 #define CAT(a, ...) PRIMITIVE_CAT(a, __VA_ARGS__) 255 #define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ 262 #define SECOND(a, b, ...) b 271 #define LE_DEFAULT(...) SECOND(__VA_ARGS__) 297 #define LE_SHARED __attribute__((visibility ("default"))) 324 #ifdef __GNUC_GNU_INLINE__ 326 # define LE_DECLARE_INLINE extern inline 327 # define LE_DEFINE_INLINE inline 330 # define LE_DECLARE_INLINE inline 331 # define LE_DEFINE_INLINE extern inline 335 #ifndef __is_identifier 336 # define __is_identifier(x) 1 339 #ifndef __has_warning 340 # define __has_warning(x) 0 343 #ifndef __has_attribute 344 # define __has_attribute(x) 0 347 #if !__is_identifier(_Nonnull) 350 # if __has_warning("-Wnullability-completeness") 351 # pragma clang diagnostic ignored "-Wnullability-completeness" 359 # define LE_NONNULL _Nonnull 366 # define LE_NULLABLE _Nullable 379 #define LE_UNUSED(v) ((void) (v)) 386 #if (__STDC_VERSION__ >= 199901L) || LE_CONFIG_LINUX 387 # define __PRIS_PREFIX "z" 388 #elif defined(__LP64__) || defined(_LP64) 389 # define __PRIS_PREFIX "ll" 391 # define __PRIS_PREFIX "l" 394 #define PRIdS __PRIS_PREFIX "d" 395 #define PRIxS __PRIS_PREFIX "x" 396 #define PRIuS __PRIS_PREFIX "u" 397 #define PRIXS __PRIS_PREFIX "X" 398 #define PRIoS __PRIS_PREFIX "o" 401 #if !defined(static_assert) && !defined(__cplusplus) 407 # if __GNUC__ || __STDC_VERSION__ >= 201112L 408 # define static_assert(cond, msg) _Static_assert((cond), #cond ": " msg) 410 # define static_assert(cond, msg) ((void)sizeof(char[1 - 2*!(cond)])) 416 # define inline_static_assert(cond, msg) ({ static_assert(cond, msg); }) 418 # define inline_static_assert(cond, msg) ((void)(0)) 426 #define LE_CONFIG_IS_ENABLED(option) (("" STRINGIZE(option))[0] == '1') 428 #endif // LEGATO_BASICS_INCLUDE_GUARD An overflow occurred or would have occurred.
Definition: le_basics.h:56
Communications error.
Definition: le_basics.h:54
An index or other value is out of range.
Definition: le_basics.h:50
Format error.
Definition: le_basics.h:60
The process, operation, data stream, session, etc. has stopped.
Definition: le_basics.h:69
Would have caused a deadlock.
Definition: le_basics.h:59
A transient or temporary loss of a service or resource.
Definition: le_basics.h:68
Definition: le_basics.h:49
The operation is in progress.
Definition: le_basics.h:70
Definition: le_basics.h:98
Duplicate entry found or operation already performed.
Definition: le_basics.h:61
Unimplemented functionality.
Definition: le_basics.h:67
Unspecified internal error.
Definition: le_basics.h:53
The resource is busy.
Definition: le_basics.h:64
The resource is closed.
Definition: le_basics.h:63
Current user does not have permission to perform requested action.
Definition: le_basics.h:52
Definition: le_basics.h:97
Insufficient memory is available.
Definition: le_basics.h:51
Referenced item does not exist or could not be found.
Definition: le_basics.h:48
An underflow occurred or would have occurred.
Definition: le_basics.h:57
The underlying resource does not support this operation.
Definition: le_basics.h:65
Would have blocked if non-blocking behaviour was not requested.
Definition: le_basics.h:58
Parameter is invalid.
Definition: le_basics.h:62
le_onoff_t
Definition: le_basics.h:95
le_result_t
Definition: le_basics.h:45
Successful.
Definition: le_basics.h:47
The operation is suspended.
Definition: le_basics.h:71
A time-out occurred.
Definition: le_basics.h:55
An IO operation failed.
Definition: le_basics.h:66