Wirepas SDK
compilersupport_p.h File Reference

Go to the source code of this file.

Functions

static bool add_check_overflow (size_t v1, size_t v2, size_t *r)
 

Macros

#define _BSD_SOURCE
 
#define _DEFAULT_SOURCE
 
#define cbor_static_assert(x)   ((void)sizeof(char[2*!!(x) - 1]))
 
#define inline   CBOR_INLINE
 
#define cbor_assert(cond)   assert(cond)
 
#define STRINGIFY(x)   STRINGIFY2(x)
 
#define STRINGIFY2(x)   #x
 
#define DBL_DECIMAL_DIG   17
 
#define DBL_DECIMAL_DIG_STR   STRINGIFY(DBL_DECIMAL_DIG)
 
#define CBOR_INTERNAL_API_CC
 
#define __has_builtin(x)   0
 
#define cbor_ntohs   ntohs
 
#define cbor_htons   htons
 
#define cbor_ntohl   ntohl
 
#define cbor_htonl   htonl
 
#define cbor_ntohll   ntohll
 
#define cbor_htonll   htonll
 
#define CONST_CAST(t, v)   (t)(uintptr_t)(v)
 
#define likely(x)   (x)
 
#define unlikely(x)   (x)
 
#define unreachable()   do {} while (0)
 

Function Documentation

◆ add_check_overflow()

static bool add_check_overflow ( size_t  v1,
size_t  v2,
size_t *  r 
)
static

Definition at line 193 of file compilersupport_p.h.

194 {
195 #if ((defined(__GNUC__) && (__GNUC__ >= 5)) && !defined(__INTEL_COMPILER)) || __has_builtin(__builtin_add_overflow)
196  return __builtin_add_overflow(v1, v2, r);
197 #else
198  /* unsigned additions are well-defined */
199  *r = v1 + v2;
200  return v1 > v1 + v2;
201 #endif
202 }

Macro Definition Documentation

◆ __has_builtin

#define __has_builtin (   x)    0

Definition at line 92 of file compilersupport_p.h.

◆ _BSD_SOURCE

#define _BSD_SOURCE

Definition at line 31 of file compilersupport_p.h.

◆ _DEFAULT_SOURCE

#define _DEFAULT_SOURCE

Definition at line 34 of file compilersupport_p.h.

◆ cbor_assert

#define cbor_assert (   cond)    assert(cond)

Definition at line 64 of file compilersupport_p.h.

◆ cbor_htonl

#define cbor_htonl   htonl

Definition at line 140 of file compilersupport_p.h.

◆ cbor_htonll

#define cbor_htonll   htonll

Definition at line 144 of file compilersupport_p.h.

◆ cbor_htons

#define cbor_htons   htons

Definition at line 135 of file compilersupport_p.h.

◆ CBOR_INTERNAL_API_CC

#define CBOR_INTERNAL_API_CC

Definition at line 88 of file compilersupport_p.h.

◆ cbor_ntohl

#define cbor_ntohl   ntohl

Definition at line 139 of file compilersupport_p.h.

◆ cbor_ntohll

#define cbor_ntohll   ntohll

Definition at line 143 of file compilersupport_p.h.

◆ cbor_ntohs

#define cbor_ntohs   ntohs

Definition at line 134 of file compilersupport_p.h.

◆ cbor_static_assert

#define cbor_static_assert (   x)    ((void)sizeof(char[2*!!(x) - 1]))

Definition at line 52 of file compilersupport_p.h.

◆ CONST_CAST

#define CONST_CAST (   t,
 
)    (t)(uintptr_t)(v)

Definition at line 172 of file compilersupport_p.h.

◆ DBL_DECIMAL_DIG

#define DBL_DECIMAL_DIG   17

Definition at line 79 of file compilersupport_p.h.

◆ DBL_DECIMAL_DIG_STR

#define DBL_DECIMAL_DIG_STR   STRINGIFY(DBL_DECIMAL_DIG)

Definition at line 81 of file compilersupport_p.h.

◆ inline

#define inline   CBOR_INLINE

Definition at line 58 of file compilersupport_p.h.

◆ likely

#define likely (   x)    (x)

Definition at line 188 of file compilersupport_p.h.

◆ STRINGIFY

#define STRINGIFY (   x)    STRINGIFY2(x)

Definition at line 68 of file compilersupport_p.h.

◆ STRINGIFY2

#define STRINGIFY2 (   x)    #x

Definition at line 70 of file compilersupport_p.h.

◆ unlikely

#define unlikely (   x)    (x)

Definition at line 189 of file compilersupport_p.h.

◆ unreachable

#define unreachable ( )    do {} while (0)

Definition at line 190 of file compilersupport_p.h.