LibJuno 0.42.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 JUNO_ASSERT_EXISTS(ptr)
 
#define JUNO_JUNO_ASSERT_EXISTS_MODULE(ptr, ptMod, str)
 
#define JUNO_ASSERT_SUCCESS(tStatus, failOp)
 

Macro Definition Documentation

◆ JUNO_ASSERT_EXISTS

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

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

Parameters
ptrA pointer or pointers concatinated with &&

◆ JUNO_ASSERT_SUCCESS

#define JUNO_ASSERT_SUCCESS (   tStatus,
  failOp 
)
Value:
if(tStatus != JUNO_STATUS_SUCCESS) \
{ \
failOp; \
}
#define 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

◆ JUNO_JUNO_ASSERT_EXISTS_MODULE

#define JUNO_JUNO_ASSERT_EXISTS_MODULE (   ptr,
  ptMod,
  str 
)
Value:
if(!(ptr)) \
{ \
JUNO_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 JUNO_ASSERT_EXISTS)
ptModThe module
strThe error message if ptr fails assertion