EVE 1.0
toc-instance.h File Reference

TOC table compile-time genarator. More...

#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <limits>
#include <type_traits>
#include <toc/autogen/int2type.h>
#include <toc/autogen/static-counter.h>
#include <toc/autogen/string-table.h>
#include <toc/autogen/label-table.h>
#include <toc/autogen/ble-id-table.h>
#include <toc/autogen/flags.h>
Include dependency graph for toc-instance.h:

Go to the source code of this file.

Macros

#define TOC_LIMIT_OVERFLOWS(mmin, mmax, test)
 
#define TOC_NEED_EXTERN_LIMITS(mmin, mmax)    (TOC_LIMIT_OVERFLOWS(mmin, mmax, mmin) || TOC_LIMIT_OVERFLOWS(mmin, mmax, mmax))
 

Detailed Description

TOC table compile-time genarator.

Author
DT, Jetro AS

Definition in file toc-instance.h.

Macro Definition Documentation

#define TOC_LIMIT_OVERFLOWS (   mmin,
  mmax,
  test 
)
Value:
(((uint32_t)mmin > (uint32_t)mmax) ? \
((int32_t)test > std::numeric_limits<int16_t>::max() || (int32_t)test < std::numeric_limits<int16_t>::min()) : \
((uint32_t)test > std::numeric_limits<uint16_t>::max() || (uint32_t)test < std::numeric_limits<uint16_t>::min()))

The utility macro check if a value "test" does not fit into xint16_t representation. "mmin" and "mmax" are used to distinguish between signed and unsigned values.

Definition at line 56 of file toc-instance.h.

#define TOC_NEED_EXTERN_LIMITS (   mmin,
  mmax 
)    (TOC_LIMIT_OVERFLOWS(mmin, mmax, mmin) || TOC_LIMIT_OVERFLOWS(mmin, mmax, mmax))

The utility macro check if one of "mmin" and "mmax" does not fit into xint16_t representation.

Definition at line 64 of file toc-instance.h.