source: lib/lt_inttypes.h @ 566e404

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 566e404 was e3b0188, checked in by Daniel Lawson <dlawson@…>, 16 years ago

a lot of changes for cross-compilation support

  • header ordering
  • os-specific headers
  • an lt_inttypes.h which defines PRIu64 etc for platforms that don't have them
  • removed daglegacy.h, merged with dagformat.h
  • Property mode set to 100644
File size: 1.3 KB
Line 
1#ifndef LT_INTTYPES_H
2#define LT_INTTYPES_H 1
3
4#ifndef PRIu64
5/* We need PRIu64 and others, but inttypes.h either doesn't exist, or it
6 * doesn't have these identifiers. We define them ourselves...
7 */
8
9/* The ISO C99 standard specifies that these macros must only be
10   defined if explicitly requested.  */
11# if !defined __cplusplus || defined __STDC_FORMAT_MACROS
12
13#  if __WORDSIZE == 64
14#   define __PRI64_PREFIX        "l"
15#   define __PRIPTR_PREFIX       "l"
16#  else
17#   define __PRI64_PREFIX        "ll"
18#   define __PRIPTR_PREFIX
19#  endif
20
21#  define PRId8                 "d"
22#  define PRId16                "d"
23#  define PRId32                "d"
24#  define PRId64                __PRI64_PREFIX "d"
25
26#  define PRIi8                 "i"
27#  define PRIi16                "i"
28#  define PRIi32                "i"
29#  define PRIi64                __PRI64_PREFIX "i"
30
31#  define PRIo8                 "o"
32#  define PRIo16                "o"
33#  define PRIo32                "o"
34#  define PRIo64                __PRI64_PREFIX "o"
35
36#  define PRIu8                 "u"
37#  define PRIu16                "u"
38#  define PRIu32                "u"
39#  define PRIu64                __PRI64_PREFIX "u"
40
41#  define PRIx8                 "x"
42#  define PRIx16                "x"
43#  define PRIx32                "x"
44#  define PRIx64                __PRI64_PREFIX "x"
45
46#  define PRIX8                 "X"
47#  define PRIX16                "X"
48#  define PRIX32                "X"
49#  define PRIX64                __PRI64_PREFIX "X"
50
51# endif
52
53# ifndef UINT64_MAX
54#  if __WORDSIZE == 64
55#   define UINT64_MAX    18446744073709551615UL
56#  else
57#   define UINT64_MAX    18446744073709551615ULL
58#  endif
59# endif
60
61#endif
62
63#endif
Note: See TracBrowser for help on using the repository browser.