RTEMS 7.0-rc1
Loading...
Searching...
No Matches
inttypes.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
14/*
15 * COPYRIGHT (c) 2017 On-Line Applications Research Corporation.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef _RTEMS_INTTYPES_H
40#define _RTEMS_INTTYPES_H
41
42#include <inttypes.h>
43#include <rtems/score/cpuopts.h>
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
59#if __RTEMS_SIZEOF_INO_T__ == 8
60#define PRIdino_t PRId64
61#elif __RTEMS_SIZEOF_INO_T__ == 4
62#define PRIdino_t PRId32
63#else
64#error "PRIdino_t: unsupported size of ino_t"
65#endif
66
68#if __RTEMS_SIZEOF_MODE_T__ == 8
69#define PRIomode_t PRIo64
70#elif __RTEMS_SIZEOF_MODE_T__ == 4
71#define PRIomode_t PRIo32
72#else
73#error "PRIomode_t: unsupported size of mode_t"
74#endif
75
77#if __RTEMS_SIZEOF_OFF_T__ == 8
78#define PRIooff_t PRIo64
79#elif __RTEMS_SIZEOF_OFF_T__ == 4
80#define PRIooff_t PRIo32
81#else
82#error "PRIooff_t: unsupported size of off_t"
83#endif
84
86#if __RTEMS_SIZEOF_OFF_T__ == 8
87#define PRIdoff_t PRId64
88#elif __RTEMS_SIZEOF_OFF_T__ == 4
89#define PRIdoff_t PRId32
90#else
91#error "PRIdoff_t: unsupported size of off_t"
92#endif
93
95#if __RTEMS_SIZEOF_TIME_T__ == 8
96#define PRIdtime_t PRId64
97#elif __RTEMS_SIZEOF_TIME_T__ == 4
98#define PRIdtime_t PRId32
99#else
100#error "PRIdtime_t: unsupported size of time_t"
101#endif
102
104#if __RTEMS_SIZEOF_BLKSIZE_T__ == 8
105#define PRIxblksize_t PRIx64
106#elif __RTEMS_SIZEOF_BLKSIZE_T__ == 4
107#define PRIxblksize_t PRIx32
108#else
109/* Warn and fall back to "long" */
110#warning "unsupported size of blksize_t"
111#define PRIxblksize_t "lx"
112#endif
113
115#if __RTEMS_SIZEOF_BLKCNT_T__ == 8
116#define PRIxblkcnt_t PRIx64
117#elif __RTEMS_SIZEOF_BLKCNT_T__ == 4
118#define PRIxblkcnt_t PRIx32
119#else
120/* Warn and fall back to "long" */
121#warning "unsupported size of blkcnt_t"
122#define PRIxblkcnt_t "lx"
123#endif
124
125/*
126 * Various inttypes.h-stype macros to assist printing
127 * certain system types on different targets.
128 */
129
130#define PRIxrtems_id PRIx32
131
132/* c.f. cpukit/score/include/rtems/score/priority.h */
133#define PRIdPriority_Control PRIu64
134#define PRIxPriority_Control PRIx64
135/* rtems_task_priority is a typedef to Priority_Control */
136#define PRIdrtems_task_priority PRIu32
137#define PRIxrtems_task_priority PRIx32
138
139/* c.f. cpukit/score/include/rtems/score/watchdog.h */
140#define PRIdWatchdog_Interval PRIu32
141/* rtems_interval is a typedef to Watchdog_Interval */
142#define PRIdrtems_interval PRIdWatchdog_Interval
143
144/* c.f. cpukit/score/include/rtems/score/thread.h */
145#define PRIdThread_Entry_numeric_type PRIuPTR
146/* rtems_task_argument is a typedef to Thread_Entry_numeric_type */
147#define PRIdrtems_task_argument PRIdThread_Entry_numeric_type
148
149/* rtems_event_set is a typedef to uint32_t */
150#define PRIxrtems_event_set PRIx32
151
152/* newlib defines pthread_t as a typedef to __uint32_t which matches
153 * RTEMS expectations for an Object ID.
154 */
155#define PRIxpthread_t PRIx32
156
157/* rtems_signal_set is a typedef to uint32_t */
158#define PRIxrtems_signal_set PRIx32
159
160/* newlib's ino_t is a typedef to __uint64_t */
161#define PRIuino_t PRIu64
162
163/* newlib's ino_t is a typedef to __uint64_t */
164#define PRIxino_t PRIx64
165
166/* ioctl_command_t */
167#define PRIdioctl_command_t "ld"
168
169/* rtems_blkdev_bnum */
170#define PRIdrtems_blkdev_bnum PRId32
171
172/* rtems_blkdev_bnum */
173#define PRIdrtems_blkdev_bnum PRId32
174
175/* rtems_vector_number */
176#define PRIdrtems_vector_number PRId32
177
180#ifdef __cplusplus
181}
182#endif
183
184#endif
Provide printf() PRIxxx Constante Beyond Standards.