source: lib/lt_inttypes.h @ 95ca714

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivendag_formatrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 95ca714 was ee6e802, checked in by Shane Alcock <salcock@…>, 5 years ago

Updated copyright blurb on all source files

In some cases, this meant adding copyright blurbs to files that
had never had them before.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2 *
3 * Copyright (c) 2007-2016 The University of Waikato, Hamilton, New Zealand.
4 * All rights reserved.
5 *
6 * This file is part of libtrace.
7 *
8 * This code has been developed by the University of Waikato WAND
9 * research group. For further information please see http://www.wand.net.nz/
10 *
11 * libtrace is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * libtrace is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 *
24 *
25 */
26/** @file
27 *
28 * @brief Header that provides local definitions of the various format
29 * identifiers used for printing various numeric types
30 */
31
32#ifndef LT_INTTYPES_H
33#define LT_INTTYPES_H 1 /**< Include Guard */
34
35#ifndef PRIu64
36/* We need PRIu64 and others, but inttypes.h either doesn't exist, or it
37 * doesn't have these identifiers. We define them ourselves...
38 */
39
40/* The ISO C99 standard specifies that these macros must only be
41   defined if explicitly requested.  */
42# if !defined __cplusplus || defined __STDC_FORMAT_MACROS
43
44#  if __WORDSIZE == 64
45#   define __PRI64_PREFIX        "l"
46#   define __PRIPTR_PREFIX       "l"
47#  else
48#   define __PRI64_PREFIX        "ll"
49#   define __PRIPTR_PREFIX
50#  endif
51
52#  define PRId8                 "d"                     /**< Print format for an 8 bit integer */
53#  define PRId16                "d"                     /**< Print format for a 16 bit integer */
54#  define PRId32                "d"                     /**< Print format for a 32 bit integer */
55#  define PRId64                __PRI64_PREFIX "d"      /**< Print format for a 64 bit integer */
56
57#  define PRIi8                 "i"                     /**< Print format for an 8 bit integer */
58#  define PRIi16                "i"                     /**< Print format for a 16 bit integer */
59#  define PRIi32                "i"                     /**< Print format for a 32 bit integer */
60#  define PRIi64                __PRI64_PREFIX "i"      /**< Print format for a 64 bit integer */
61
62#  define PRIo8                 "o"                     /**< Print format for an 8 bit octal */
63#  define PRIo16                "o"                     /**< Print format for a 16 bit octal */
64#  define PRIo32                "o"                     /**< Print format for a 32 bit octal */
65#  define PRIo64                __PRI64_PREFIX "o"      /**< Print format for a 64 bit octal */
66
67#  define PRIu8                 "u"
68#  define PRIu16                "u"
69#  define PRIu32                "u"
70#  define PRIu64                __PRI64_PREFIX "u"
71
72#  define PRIx8                 "x"
73#  define PRIx16                "x"
74#  define PRIx32                "x"
75#  define PRIx64                __PRI64_PREFIX "x"
76
77#  define PRIX8                 "X"
78#  define PRIX16                "X"
79#  define PRIX32                "X"
80#  define PRIX64                __PRI64_PREFIX "X"
81
82# endif
83
84# ifndef UINT64_MAX
85#  if __WORDSIZE == 64
86#   define UINT64_MAX    18446744073709551615UL         /**< Maximum value of a uint64_t */
87#  else
88#   define UINT64_MAX    18446744073709551615ULL        /**< Maximum value of a uint64_t */
89#  endif
90# endif
91
92#endif
93
94#endif
Note: See TracBrowser for help on using the repository browser.