LibJuno 0.23.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
macros.h File Reference
#include "juno/status.h"
#include <stdint.h>
Include dependency graph for macros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ASSERT_EXISTS(ptr)
 
#define ASSERT_EXISTS_MODULE(ptr, ptMod, str)
 
#define ASSERT_SUCCESS(tStatus, failOp)
 

Macro Definition Documentation

◆ ASSERT_EXISTS

#define ASSERT_EXISTS (   ptr)
Value:
if(!(ptr)) \
{ \
}
@ JUNO_STATUS_NULLPTR_ERROR
Definition status.h:26

Assert if ptr exists. For example ASSERT_EXISTS(ptMyPointerFoo) or ASSERT_EXISTS(ptMyPointerFoo && ptMyPointerBar)

Parameters
ptrA pointer or pointers concatinated with &&

◆ ASSERT_EXISTS_MODULE

#define ASSERT_EXISTS_MODULE (   ptr,
  ptMod,
  str 
)
Value:
if(!(ptr)) \
{ \
FAIL_MODULE(JUNO_STATUS_NULLPTR_ERROR, ptMod, str); \
}

Assert if a module's dependencies exist

Parameters
ptrthe Module dependecy or dependencies to assert (similar to ASSERT_EXISTS)
ptModThe module
strThe error message if ptr fails assertion

◆ ASSERT_SUCCESS

#define ASSERT_SUCCESS (   tStatus,
  failOp 
)
Value:
if(tStatus != JUNO_STATUS_SUCCESS) \
{ \
failOp; \
}
@ JUNO_STATUS_SUCCESS
Definition status.h:24

Assert the status is a success, if not perform failOp

Parameters
tStatusThe status to assert
failOpThe failure operation