7#ifndef ZEPHYR_INCLUDE_SYS_CBPRINTF_CXX_H_
8#define ZEPHYR_INCLUDE_SYS_CBPRINTF_CXX_H_
12static inline int z_cbprintf_cxx_is_pchar(
char *,
bool const_as_fixed)
14 ARG_UNUSED(const_as_fixed);
18static inline int z_cbprintf_cxx_is_pchar(
const char *,
bool const_as_fixed)
20 return const_as_fixed ? 0 : 1;
23static inline int z_cbprintf_cxx_is_pchar(
volatile char *,
bool const_as_fixed)
25 ARG_UNUSED(const_as_fixed);
29static inline int z_cbprintf_cxx_is_pchar(
const volatile char *,
bool const_as_fixed)
31 ARG_UNUSED(const_as_fixed);
35static inline int z_cbprintf_cxx_is_pchar(
unsigned char *,
bool const_as_fixed)
37 ARG_UNUSED(const_as_fixed);
41static inline int z_cbprintf_cxx_is_pchar(
const unsigned char *,
bool const_as_fixed)
43 return const_as_fixed ? 0 : 1;
46static inline int z_cbprintf_cxx_is_pchar(
volatile unsigned char *,
bool const_as_fixed)
48 ARG_UNUSED(const_as_fixed);
52static inline int z_cbprintf_cxx_is_pchar(
const volatile unsigned char *,
bool const_as_fixed)
54 ARG_UNUSED(const_as_fixed);
57static inline int z_cbprintf_cxx_is_pchar(
wchar_t *,
bool const_as_fixed)
59 ARG_UNUSED(const_as_fixed);
63static inline int z_cbprintf_cxx_is_pchar(
const wchar_t *,
bool const_as_fixed)
65 return const_as_fixed ? 0 : 1;
68static inline int z_cbprintf_cxx_is_pchar(
volatile wchar_t *,
bool const_as_fixed)
70 ARG_UNUSED(const_as_fixed);
74static inline int z_cbprintf_cxx_is_pchar(
const volatile wchar_t *,
bool const_as_fixed)
76 ARG_UNUSED(const_as_fixed);
80template <
typename T >
81static inline int z_cbprintf_cxx_is_pchar(T arg,
bool const_as_fixed)
85 ARG_UNUSED(const_as_fixed);
91static inline int z_cbprintf_cxx_is_word_num(
char)
96static inline int z_cbprintf_cxx_is_word_num(
unsigned char)
101static inline int z_cbprintf_cxx_is_word_num(
short)
106static inline int z_cbprintf_cxx_is_word_num(
unsigned short)
111static inline int z_cbprintf_cxx_is_word_num(
int)
116static inline int z_cbprintf_cxx_is_word_num(
unsigned int)
121static inline int z_cbprintf_cxx_is_word_num(
long)
123 return (
sizeof(
long) <=
sizeof(
uint32_t)) ? 1 : 0;
126static inline int z_cbprintf_cxx_is_word_num(
unsigned long)
128 return (
sizeof(
long) <=
sizeof(
uint32_t)) ? 1 : 0;
131template <
typename T >
132static inline int z_cbprintf_cxx_is_word_num(T arg)
141static inline int z_cbprintf_cxx_is_none_char_ptr(
char)
146static inline int z_cbprintf_cxx_is_none_char_ptr(
unsigned char)
151static inline int z_cbprintf_cxx_is_none_char_ptr(
short)
156static inline int z_cbprintf_cxx_is_none_char_ptr(
unsigned short)
161static inline int z_cbprintf_cxx_is_none_char_ptr(
int)
166static inline int z_cbprintf_cxx_is_none_char_ptr(
unsigned int)
171static inline int z_cbprintf_cxx_is_none_char_ptr(
long)
176static inline int z_cbprintf_cxx_is_none_char_ptr(
unsigned long)
181static inline int z_cbprintf_cxx_is_none_char_ptr(
long long)
186static inline int z_cbprintf_cxx_is_none_char_ptr(
unsigned long long)
191static inline int z_cbprintf_cxx_is_none_char_ptr(
float)
196static inline int z_cbprintf_cxx_is_none_char_ptr(
double)
201static inline int z_cbprintf_cxx_is_none_char_ptr(
char *)
206static inline int z_cbprintf_cxx_is_none_char_ptr(
volatile char *)
211static inline int z_cbprintf_cxx_is_none_char_ptr(
const char *)
216static inline int z_cbprintf_cxx_is_none_char_ptr(
const volatile char *)
221static inline int z_cbprintf_cxx_is_none_char_ptr(
unsigned char *)
226static inline int z_cbprintf_cxx_is_none_char_ptr(
volatile unsigned char *)
231static inline int z_cbprintf_cxx_is_none_char_ptr(
const unsigned char *)
236static inline int z_cbprintf_cxx_is_none_char_ptr(
const volatile unsigned char *)
241template <
typename T >
242static inline int z_cbprintf_cxx_is_none_char_ptr(T arg)
250static inline size_t z_cbprintf_cxx_arg_size(
float f)
254 return sizeof(double);
257template <
typename T >
258static inline size_t z_cbprintf_cxx_arg_size(T arg)
262 return MAX(
sizeof(T),
sizeof(
int));
266static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
float arg)
268 double d = (double)arg;
271 z_cbprintf_wcpy((
int *)dst, (
int *)p,
sizeof(
d) /
sizeof(
int));
274static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
void *p)
276 z_cbprintf_wcpy((
int *)dst, (
int *)&p,
sizeof(p) /
sizeof(
int));
279static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
char arg)
283 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
286static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
unsigned char arg)
290 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
293static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
signed char arg)
297 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
300static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
short arg)
304 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
307static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
unsigned short arg)
311 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
314template <
typename T >
315static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst, T arg)
317 size_t wlen = z_cbprintf_cxx_arg_size(arg) /
sizeof(int);
320 z_cbprintf_wcpy((
int *)dst, (
int *)p, wlen);
324static inline int z_cbprintf_cxx_is_longdouble(
long double arg)
330template <
typename T >
331static inline int z_cbprintf_cxx_is_longdouble(T arg)
339static inline size_t z_cbprintf_cxx_alignment(
float arg)
346static inline size_t z_cbprintf_cxx_alignment(
double arg)
353static inline size_t z_cbprintf_cxx_alignment(
long double arg)
360static inline size_t z_cbprintf_cxx_alignment(
long long arg)
367static inline size_t z_cbprintf_cxx_alignment(
unsigned long long arg)
374template <
typename T >
375static inline size_t z_cbprintf_cxx_alignment(T arg)
381template <
typename T1,
typename T2 >
382struct z_cbprintf_cxx_is_same_type {
388template <
typename T >
389struct z_cbprintf_cxx_is_same_type < T, T > {
395template <
typename T >
396struct z_cbprintf_cxx_remove_reference {
400template <
typename T >
401struct z_cbprintf_cxx_remove_reference < T & > {
405#if __cplusplus >= 201103L
406template <
typename T >
407struct z_cbprintf_cxx_remove_reference < T && > {
412template <
typename T >
413struct z_cbprintf_cxx_remove_cv {
417template <
typename T >
418struct z_cbprintf_cxx_remove_cv < const T > {
422template <
typename T >
423struct z_cbprintf_cxx_remove_cv < volatile T > {
427template <
typename T >
428struct z_cbprintf_cxx_remove_cv < const volatile T > {
433template <
typename T >
434struct z_cbprintf_cxx_is_array {
440template <
typename T >
441struct z_cbprintf_cxx_is_array < T[] > {
447template <
typename T,
size_t N >
448struct z_cbprintf_cxx_is_array < T[N] > {
455template <
typename T >
456struct z_cbprintf_cxx_remove_extent {
460template <
typename T >
461struct z_cbprintf_cxx_remove_extent < T[] > {
465template <
typename T,
size_t N >
466struct z_cbprintf_cxx_remove_extent < T[N] > {
irp nz macro MOVR cc d
Definition asm-macro-32-bit-gnu.h:11
#define VA_STACK_MIN_ALIGN
Definition cbprintf_internal.h:48
#define VA_STACK_ALIGN(type)
Definition cbprintf_internal.h:52
#define MAX(a, b)
Obtain the maximum of two values.
Definition util.h:387
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88