Changeset d420b67 in rtems


Ignore:
Timestamp:
04/14/17 20:18:56 (7 years ago)
Author:
Joel Sherrill <joel@…>
Branches:
5, master
Children:
4fd25c4
Parents:
54bdf0c
git-author:
Joel Sherrill <joel@…> (04/14/17 20:18:56)
git-committer:
Joel Sherrill <joel@…> (04/18/17 16:24:46)
Message:

Merge tmacros.h PRIxxx constants from testsuites/ into <rtems/inttypes.h>

This completes the initial creation of rtems/inttypes.h based on all
existing PRIxxx definitions contained in RTEMS Project owned code.

closes #2983.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/configure.ac

    r54bdf0c rd420b67  
    239239  [Define to 1 if ada/gnat bindings are built-in])
    240240
     241# These are used to provide <rtems/inttypes.h
     242AC_CHECK_SIZEOF([mode_t])
     243AC_CHECK_SIZEOF([off_t])
     244AC_CHECK_SIZEOF([time_t])
     245AC_CHECK_SIZEOF([size_t])
     246
     247## Provide sizeof(mode_t) information via cpuopts.h
     248RTEMS_CPUOPT([__RTEMS_SIZEOF_MODE_T__],
     249  [true],
     250  [${ac_cv_sizeof_mode_t}],
     251  [sizeof(mode_t)])
     252
     253## Provide sizeof(off_t) information via cpuopts.h
     254RTEMS_CPUOPT([__RTEMS_SIZEOF_OFF_T__],
     255  [true],
     256  [${ac_cv_sizeof_off_t}],
     257  [sizeof(off_t)])
     258
     259## Provide sizeof(time_t) information via cpuopts.h
     260RTEMS_CPUOPT([__RTEMS_SIZEOF_TIME_T__],
     261  [true],
     262  [${ac_cv_sizeof_time_t}],
     263  [sizeof(time_t)])
     264
    241265## Then we propagate a private copy of the value into cpuopts.h
    242266## so it is always available to the RTEMS header files.
     
    252276  [minor version portion of an RTEMS release])
    253277
    254 RTEMS_CPUOPT([__RTEMS_REVISION__],
     278RTEMS_CPUOPT([__RTEMS_REVISION___],
    255279  [true],
    256280  [$rtems_revision],
     
    278302AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
    279303AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
    280 
    281 # FIXME: We should get rid of this.
    282 # So far, only used in libfs/src/nfsclient/src/dirutils.c
    283 AC_CHECK_SIZEOF([mode_t])
    284 AC_CHECK_SIZEOF([off_t])
    285 
    286 # FIXME: We should get rid of this. It's a cludge.
    287 AC_CHECK_SIZEOF([time_t])
    288 
    289 AC_CHECK_SIZEOF([size_t])
    290304
    291305# FIXME: Mandatory in SUSv4, optional in SUSv3.
  • cpukit/include/rtems/inttypes.h

    r54bdf0c rd420b67  
    2222
    2323#include <inttypes.h>
     24#include <rtems/score/cpuopts.h>
    2425
    2526#ifdef __cplusplus
     
    3536
    3637/** Helper macro to print "modet" in octal */
    37 #if SIZEOF_MODE_T == 8
     38#if __RTEMS_SIZEOF_MODE_T__ == 8
    3839#define PRIomode_t PRIo64
    39 #elif SIZEOF_MODE_T == 4
     40#elif __RTEMS_SIZEOF_MODE_T__ == 4
    4041#define PRIomode_t PRIo32
    4142#else
    42 #error "PRIomode_t: unsupport size of mode_t"
     43#error "PRIomode_t: unsupported size of mode_t"
    4344#endif
    4445
    4546/** Helper macro to print "off_t" in octal */
    46 #if SIZEOF_OFF_T == 8
     47#if __RTEMS_SIZEOF_OFF_T__ == 8
    4748#define PRIooff_t PRIo64
    48 #elif SIZEOF_OFF_T == 4
     49#elif __RTEMS_SIZEOF_OFF_T__ == 4
    4950#define PRIooff_t PRIo32
    5051#else
     
    5354
    5455/** Helper macro to print "off_t" in decimal */
    55 #if SIZEOF_OFF_T == 8
     56#if __RTEMS_SIZEOF_OFF_T__ == 8
    5657#define PRIdoff_t PRId64
    57 #elif SIZEOF_OFF_T == 4
     58#elif __RTEMS_SIZEOF_OFF_T__ == 4
    5859#define PRIdoff_t PRId32
    5960#else
     
    6263
    6364/** Helper macro to print "time_t" in decimal */
    64 #if SIZEOF_TIME_T == 8
     65#if __RTEMS_SIZEOF_TIME_T__ == 8
    6566#define PRIdtime_t PRId64
    66 #elif SIZEOF_TIME_T == 4
     67#elif __RTEMS_SIZEOF_TIME_T__ == 4
    6768#define PRIdtime_t PRId32
    6869#else
    6970#error "PRIdtime_t: unsupported size of time_t"
    7071#endif
     72
     73/*
     74 * Various inttypes.h-stype macros to assist printing
     75 * certain system types on different targets.
     76 */
     77
     78#if defined(RTEMS_USE_16_BIT_OBJECT)
     79#define PRIxrtems_id PRIx16
     80#else
     81#define PRIxrtems_id PRIx32
     82#endif
     83
     84/* c.f. cpukit/score/include/rtems/score/priority.h */
     85#define PRIdPriority_Control PRIu64
     86#define PRIxPriority_Control PRIx64
     87/* rtems_task_priority is a typedef to Priority_Control */
     88#define PRIdrtems_task_priority PRIu32
     89#define PRIxrtems_task_priority PRIx32
     90
     91/* c.f. cpukit/score/include/rtems/score/watchdog.h */
     92#define PRIdWatchdog_Interval PRIu32
     93/* rtems_interval is a typedef to Watchdog_Interval */
     94#define PRIdrtems_interval    PRIdWatchdog_Interval
     95
     96/* c.f. cpukit/score/include/rtems/score/thread.h */
     97#define PRIdThread_Entry_numeric_type PRIuPTR
     98/* rtems_task_argument is a typedef to Thread_Entry_numeric_type */
     99#define PRIdrtems_task_argument PRIdThread_Entry_numeric_type
     100
     101/* rtems_event_set is a typedef to unit32_t */
     102#define PRIxrtems_event_set PRIx32
     103
     104/* HACK: newlib defines pthread_t as a typedef to __uint32_t */
     105/* HACK: There is no portable way to print pthread_t's */
     106#define PRIxpthread_t PRIx32
     107
     108/* rtems_signal_set is a typedef to uint32_t */
     109#define PRIxrtems_signal_set PRIx32
     110
     111/* newlib's ino_t is a typedef to "unsigned long" */
     112#define PRIxino_t "lx"
    71113
    72114/**@}*/
  • testsuites/support/include/tmacros.h

    r54bdf0c rd420b67  
    1919
    2020#include <inttypes.h>
     21#include <rtems/inttypes.h>
    2122#include <bsp.h>    /* includes <rtems.h> */
    2223
     
    306307  } while (0)
    307308
    308 /*
    309  * Various inttypes.h-stype macros to assist printing
    310  * certain system types on different targets.
    311  */
    312 
    313 #if defined(RTEMS_USE_16_BIT_OBJECT)
    314 #define PRIxrtems_id PRIx16
    315 #else
    316 #define PRIxrtems_id PRIx32
    317 #endif
    318 
    319 /* c.f. cpukit/score/include/rtems/score/priority.h */
    320 #define PRIdPriority_Control PRIu64
    321 #define PRIxPriority_Control PRIx64
    322 /* rtems_task_priority is a typedef to Priority_Control */
    323 #define PRIdrtems_task_priority PRIu32
    324 #define PRIxrtems_task_priority PRIx32
    325 
    326 /* c.f. cpukit/score/include/rtems/score/watchdog.h */
    327 #define PRIdWatchdog_Interval PRIu32
    328 /* rtems_interval is a typedef to Watchdog_Interval */
    329 #define PRIdrtems_interval    PRIdWatchdog_Interval
    330 
    331 /* c.f. cpukit/score/include/rtems/score/thread.h */
    332 #define PRIdThread_Entry_numeric_type PRIuPTR
    333 /* rtems_task_argument is a typedef to Thread_Entry_numeric_type */
    334 #define PRIdrtems_task_argument PRIdThread_Entry_numeric_type
    335 
    336 /* rtems_event_set is a typedef to unit32_t */
    337 #define PRIxrtems_event_set PRIx32
    338 
    339 /* HACK: newlib defines pthread_t as a typedef to __uint32_t */
    340 /* HACK: There is no portable way to print pthread_t's */
    341 #define PRIxpthread_t PRIx32
    342 
    343 /* rtems_signal_set is a typedef to uint32_t */
    344 #define PRIxrtems_signal_set PRIx32
    345 
    346 /* newlib's ino_t is a typedef to "unsigned long" */
    347 #define PRIxino_t "lx"
    348 
    349309/**
    350310 * This assists in clearly disabling warnings on GCC in certain very
Note: See TracChangeset for help on using the changeset viewer.