OSDN Git Service

* crontab, doc_exclude, update_branch_version, update_version,
[pf3gnuchains/gcc-fork.git] / gcc / hwint.h
1 /* HOST_WIDE_INT definitions for the GNU compiler.
2    Copyright (C) 1998 Free Software Foundation, Inc.
3
4    This file is part of GNU CC.
5
6    Provide definitions for macros which depend on HOST_BITS_PER_INT
7    and HOST_BITS_PER_LONG. */
8
9 #ifndef __HWINT_H__
10 #define __HWINT_H__
11
12 /* This describes the machine the compiler is hosted on.  The defaults
13    we provide describe the standard 32 bit host since that is the most
14    common type supported in gcc.  */
15 #ifndef HOST_BITS_PER_CHAR
16 # define HOST_BITS_PER_CHAR 8
17 #endif
18 #ifndef HOST_BITS_PER_SHORT
19 # define HOST_BITS_PER_SHORT 16
20 #endif
21 #ifndef HOST_BITS_PER_INT
22 # define HOST_BITS_PER_INT 32
23 #endif
24 #ifndef HOST_BITS_PER_LONG
25 # define HOST_BITS_PER_LONG 32
26 #endif
27 #ifndef HOST_BITS_PER_LONGLONG
28 # define HOST_BITS_PER_LONGLONG 64
29 #endif
30
31 /* Find the largest host integer type and set its size and type.  */
32
33 #ifndef HOST_BITS_PER_WIDE_INT
34
35 # if HOST_BITS_PER_LONG > HOST_BITS_PER_INT
36 #  define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
37 #  define HOST_WIDE_INT long
38 # else
39 #  define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT
40 #  define HOST_WIDE_INT int
41 # endif
42
43 #endif /* ! HOST_BITS_PER_WIDE_INT */
44
45
46 /* Provide defaults for the way to print a HOST_WIDE_INT
47    in various manners.  */
48
49 #ifndef HOST_WIDE_INT_PRINT_DEC
50 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
51 #  define HOST_WIDE_INT_PRINT_DEC "%d"
52 # else
53 #  if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
54 #   define HOST_WIDE_INT_PRINT_DEC "%ld"
55 #  else
56 #   define HOST_WIDE_INT_PRINT_DEC "%lld"
57 #  endif
58 # endif
59 #endif /* ! HOST_WIDE_INT_PRINT_DEC */
60
61 #ifndef HOST_WIDE_INT_PRINT_UNSIGNED
62 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
63 #  define HOST_WIDE_INT_PRINT_UNSIGNED "%u"
64 # else
65 #  if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
66 #   define HOST_WIDE_INT_PRINT_UNSIGNED "%lu"
67 #  else
68 #   define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
69 #  endif
70 # endif
71 #endif /* ! HOST_WIDE_INT_PRINT_UNSIGNED */
72
73 #ifndef HOST_WIDE_INT_PRINT_HEX
74 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
75 #  define HOST_WIDE_INT_PRINT_HEX "0x%x"
76 # else
77 #  if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
78 #   define HOST_WIDE_INT_PRINT_HEX "0x%lx"
79 #  else
80 #   define HOST_WIDE_INT_PRINT_HEX "0x%llx"
81 #  endif
82 # endif
83 #endif /* ! HOST_WIDE_INT_PRINT_HEX */
84
85 #ifndef HOST_WIDE_INT_PRINT_DOUBLE_HEX
86 # if HOST_BITS_PER_WIDE_INT == 64
87 #  if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
88 #   define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%016x"
89 #  else
90 #   if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
91 #    define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%016lx"
92 #   else
93 #    define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
94 #   endif
95 #  endif
96 # else
97 #  if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
98 #   define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%08x"
99 #  else
100 #   if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
101 #    define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx"
102 #   else
103 #    define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%08llx"
104 #   endif
105 #  endif
106 # endif
107 #endif /* ! HOST_WIDE_INT_PRINT_DOUBLE_HEX */
108
109 #endif /* __HWINT_H__ */