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)
84 _Pragma(
"GCC diagnostic push")
85 _Pragma("GCC diagnostic ignored \"-Wpointer-arith\"")
86 ARG_UNUSED(const_as_fixed);
88 _Pragma("GCC diagnostic pop")
92static inline
size_t z_cbprintf_cxx_arg_size(
float f)
96 return sizeof(double);
99static inline size_t z_cbprintf_cxx_arg_size(
void *
p)
103 return sizeof(
void *);
106template <
typename T >
107static inline size_t z_cbprintf_cxx_arg_size(T arg)
109 return sizeof(arg + 0);
113static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
float arg)
115 double d = (double)arg;
118 z_cbprintf_wcpy((
int *)dst, (
int *)
p,
sizeof(
d) /
sizeof(
int));
121static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
void *
p)
123 z_cbprintf_wcpy((
int *)dst, (
int *)&
p,
sizeof(
p) /
sizeof(
int));
126static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
char arg)
130 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
133static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
unsigned char arg)
137 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
140static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
signed char arg)
144 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
147static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
short arg)
151 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
154static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst,
unsigned short arg)
158 z_cbprintf_wcpy((
int *)dst, &tmp, 1);
161template <
typename T >
162static inline void z_cbprintf_cxx_store_arg(
uint8_t *dst, T arg)
164 size_t wlen = z_cbprintf_cxx_arg_size(arg) /
sizeof(int);
167 z_cbprintf_wcpy((
int *)dst, (
int *)
p, wlen);
171static inline int z_cbprintf_cxx_is_longdouble(
long double arg)
177template <
typename T >
178static inline int z_cbprintf_cxx_is_longdouble(T arg)
186static inline size_t z_cbprintf_cxx_alignment(
float arg)
193static inline size_t z_cbprintf_cxx_alignment(
double arg)
200static inline size_t z_cbprintf_cxx_alignment(
long double arg)
207static inline size_t z_cbprintf_cxx_alignment(
long long arg)
214static inline size_t z_cbprintf_cxx_alignment(
unsigned long long arg)
221template <
typename T >
222static inline size_t z_cbprintf_cxx_alignment(T arg)
228template <
typename T1,
typename T2 >
229struct z_cbprintf_cxx_is_same_type {
235template <
typename T >
236struct z_cbprintf_cxx_is_same_type < T, T > {
242template <
typename T >
243struct z_cbprintf_cxx_remove_reference {
247template <
typename T >
248struct z_cbprintf_cxx_remove_reference < T & > {
252template <
typename T >
253struct z_cbprintf_cxx_remove_reference < T && > {
257template <
typename T >
258struct z_cbprintf_cxx_remove_cv {
262template <
typename T >
263struct z_cbprintf_cxx_remove_cv < const T > {
267template <
typename T >
268struct z_cbprintf_cxx_remove_cv < volatile T > {
272template <
typename T >
273struct z_cbprintf_cxx_remove_cv < const volatile T > {
278template <
typename T >
279struct z_cbprintf_cxx_is_array {
285template <
typename T >
286struct z_cbprintf_cxx_is_array < T[] > {
292template <
typename T,
size_t N >
293struct z_cbprintf_cxx_is_array < T[N] > {
300template <
typename T >
301struct z_cbprintf_cxx_remove_extent {
305template <
typename T >
306struct z_cbprintf_cxx_remove_extent < T[] > {
310template <
typename T,
size_t N >
311struct 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:45
#define VA_STACK_ALIGN(type)
Definition: cbprintf_internal.h:49
#define MAX(a, b)
Obtain the maximum of two values.
Definition: util.h:252
struct k_futex f
Definition: kobject.c:1330
struct k_pipe p
Definition: kobject.c:1322
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88