|
PebbleOS
|
Structure access helpers. More...
Macros | |
| #define | NULL_SAFE_FIELD_ACCESS(struct_ptr, field_name, default_value) ((struct_ptr) ? ((struct_ptr)->field_name) : (default_value)) |
| Read a structure field through a pointer that may be NULL. | |
Structure access helpers.
| #define NULL_SAFE_FIELD_ACCESS | ( | struct_ptr, | |
| field_name, | |||
| default_value | |||
| ) | ((struct_ptr) ? ((struct_ptr)->field_name) : (default_value)) |
Read a structure field through a pointer that may be NULL.
| struct_ptr | Pointer to the structure, evaluated twice. |
| field_name | Field to read. |
| default_value | Value when struct_ptr is NULL. |
struct_ptr->field_name, or default_value.