Zephyr API Documentation
4.2.0-rc3
A Scalable Open Source RTOS
4.2.0-rc3
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Zephyr API Documentation
Introduction
Deprecated List
Topics
Data Structures
Files
File List
doc
kernel
lib
modules
subsys
zephyr
acpi
app_memory
arch
audio
bluetooth
canbus
console
crypto
data
debug
devicetree
dfu
display
drivers
dsp
dt-bindings
fs
input
internal
ipc
kernel
linker
llext
logging
lorawan
math
mem_mgmt
mgmt
misc
modbus
modem
multi_heap
net
platform
pm
pmci
portability
posix
psa
random
retention
rtio
sd
sensing
settings
shell
sip_svc
stats
storage
sys
task_wdt
timing
toolchain
iar
armclang.h
common.h
gcc.h
iar.h
llvm.h
mwdt.h
xcc.h
xcc_missing_defs.h
zephyr_stdint.h
tracing
usb
usb_c
xen
zbus
zvfs
bindesc.h
cache.h
device.h
devicetree.h
fatal.h
fatal_types.h
init.h
irq.h
irq_multilevel.h
irq_nextlevel.h
irq_offload.h
kernel.h
kernel_includes.h
kernel_structs.h
kernel_version.h
net_buf.h
service.h
shared_irq.h
smf.h
spinlock.h
sw_isr_table.h
sys_clock.h
syscall.h
toolchain.h
types.h
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
zephyr_stdint.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 BayLibre SAS
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_TOOLCHAIN_STDINT_H_
8
#define ZEPHYR_INCLUDE_TOOLCHAIN_STDINT_H_
9
10
/*
11
* Some gcc versions and/or configurations as found in the Zephyr SDK
12
* (questionably) define __INT32_TYPE__ and derivatives as a long int
13
* which makes the printf format checker to complain about long vs int
14
* mismatch when %u is given a uint32_t argument, and uint32_t pointers not
15
* being compatible with int pointers. Let's redefine them to follow
16
* common expectations and usage.
17
*/
18
19
/*
20
* If the compiler does not define __SIZEOF_INT__ deduce it from __INT_MAX__
21
* or INT_MAX.
22
*/
23
#if !defined(__SIZEOF_INT__)
24
25
#if defined(__INT_MAX__)
26
/* GCC >= 3.3.0 has __<val>__ implicitly defined. */
27
#define __Z_INT_MAX __INT_MAX__
28
#else
29
/* Fall back to POSIX versions from <limits.h> */
30
#define __Z_INT_MAX INT_MAX
31
#include <
limits.h
>
32
#endif
33
34
#if __Z_INT_MAX == 0x7fff
35
#define __SIZEOF_INT__ 2
36
#elif __Z_INT_MAX == 0x7fffffffL
37
#define __SIZEOF_INT__ 4
38
#elif __Z_INT_MAX > 0x7fffffffL
39
#define __SIZEOF_INT__ 8
40
#endif
41
42
#undef __Z_INT_MAX
43
44
#endif
45
46
#if __SIZEOF_INT__ != 4
47
#error "unexpected int width"
48
#endif
49
50
#undef __INT32_TYPE__
51
#undef __UINT32_TYPE__
52
#undef __INT_FAST32_TYPE__
53
#undef __UINT_FAST32_TYPE__
54
#undef __INT_LEAST32_TYPE__
55
#undef __UINT_LEAST32_TYPE__
56
#undef __INT64_TYPE__
57
#undef __UINT64_TYPE__
58
#undef __INT_FAST64_TYPE__
59
#undef __UINT_FAST64_TYPE__
60
#undef __INT_LEAST64_TYPE__
61
#undef __UINT_LEAST64_TYPE__
62
63
#define __INT32_TYPE__ int
64
#define __UINT32_TYPE__ unsigned int
65
#define __INT_FAST32_TYPE__ __INT32_TYPE__
66
#define __UINT_FAST32_TYPE__ __UINT32_TYPE__
67
#define __INT_LEAST32_TYPE__ __INT32_TYPE__
68
#define __UINT_LEAST32_TYPE__ __UINT32_TYPE__
69
#define __INT64_TYPE__ long long int
70
#define __UINT64_TYPE__ unsigned long long int
71
#define __INT_FAST64_TYPE__ __INT64_TYPE__
72
#define __UINT_FAST64_TYPE__ __UINT64_TYPE__
73
#define __INT_LEAST64_TYPE__ __INT64_TYPE__
74
#define __UINT_LEAST64_TYPE__ __UINT64_TYPE__
75
76
/*
77
* The confusion also exists with __INTPTR_TYPE__ which is either an int
78
* (even when __INT32_TYPE__ is a long int) or a long int. Let's redefine
79
* it to a long int to get some uniformity. Doing so also makes it compatible
80
* with LP64 (64-bit) targets where a long is always 64-bit wide.
81
*/
82
83
#if __SIZEOF_POINTER__ != __SIZEOF_LONG__
84
#error "unexpected size difference between pointers and long ints"
85
#endif
86
87
#undef __INTPTR_TYPE__
88
#undef __UINTPTR_TYPE__
89
#define __INTPTR_TYPE__ long int
90
#define __UINTPTR_TYPE__ long unsigned int
91
92
/*
93
* Re-define the INTN_C(value) integer constant expression macros to match the
94
* integer types re-defined above.
95
*/
96
97
#undef __INT32_C
98
#undef __UINT32_C
99
#undef __INT64_C
100
#undef __UINT64_C
101
#define __INT32_C(c) c
102
#define __UINT32_C(c) c ## U
103
#define __INT64_C(c) c ## LL
104
#define __UINT64_C(c) c ## ULL
105
106
#endif
/* ZEPHYR_INCLUDE_TOOLCHAIN_STDINT_H_ */
limits.h
zephyr
toolchain
zephyr_stdint.h
Generated on
for Zephyr API Documentation by
1.14.0