1#ifndef __NETTLE_STDINT_H
2#define __NETTLE_STDINT_H 1
3#ifndef _GENERATED_STDINT_H
4#define _GENERATED_STDINT_H " "
5/* generated using gcc */
6#define _STDINT_HAVE_STDINT_H 1
7
8/* ................... shortcircuit part ........................... */
9
10#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
11#include <stdint.h>
12#else
13#include <stddef.h>
14
15/* .................... configured part ............................ */
16
17/* whether we have a C99 compatible stdint header file */
18/* #undef _STDINT_HEADER_INTPTR */
19/* whether we have a C96 compatible inttypes header file */
20/* #undef _STDINT_HEADER_UINT32 */
21/* whether we have a BSD compatible inet types header */
22/* #undef _STDINT_HEADER_U_INT32 */
23
24/* which 64bit typedef has been found */
25/* #undef _STDINT_HAVE_UINT64_T */
26/* #undef _STDINT_HAVE_U_INT64_T */
27
28/* which type model has been detected */
29/* #undef _STDINT_CHAR_MODEL // skipped */
30/* #undef _STDINT_LONG_MODEL // skipped */
31
32/* whether int_least types were detected */
33/* #undef _STDINT_HAVE_INT_LEAST32_T */
34/* whether int_fast types were detected */
35/* #undef _STDINT_HAVE_INT_FAST32_T */
36/* whether intmax_t type was detected */
37/* #undef _STDINT_HAVE_INTMAX_T */
38
39/* .................... detections part ............................ */
40
41/* whether we need to define bitspecific types from compiler base types */
42#ifndef _STDINT_HEADER_INTPTR
43#ifndef _STDINT_HEADER_UINT32
44#ifndef _STDINT_HEADER_U_INT32
45#define _STDINT_NEED_INT_MODEL_T
46#else
47#define _STDINT_HAVE_U_INT_TYPES
48#endif
49#endif
50#endif
51
52#ifdef _STDINT_HAVE_U_INT_TYPES
53#undef _STDINT_NEED_INT_MODEL_T
54#endif
55
56#ifdef _STDINT_CHAR_MODEL
57#if _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
58#ifndef _STDINT_BYTE_MODEL
59#define _STDINT_BYTE_MODEL 12
60#endif
61#endif
62#endif
63
64#ifndef _STDINT_HAVE_INT_LEAST32_T
65#define _STDINT_NEED_INT_LEAST_T
66#endif
67
68#ifndef _STDINT_HAVE_INT_FAST32_T
69#define _STDINT_NEED_INT_FAST_T
70#endif
71
72#ifndef _STDINT_HEADER_INTPTR
73#define _STDINT_NEED_INTPTR_T
74#ifndef _STDINT_HAVE_INTMAX_T
75#define _STDINT_NEED_INTMAX_T
76#endif
77#endif
78
79
80/* .................... definition part ............................ */
81
82/* some system headers have good uint64_t */
83#ifndef _HAVE_UINT64_T
84#if defined _STDINT_HAVE_UINT64_T || defined HAVE_UINT64_T
85#define _HAVE_UINT64_T
86#elif defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
87#define _HAVE_UINT64_T
88typedef u_int64_t uint64_t;
89#endif
90#endif
91
92#ifndef _HAVE_UINT64_T
93/* .. here are some common heuristics using compiler runtime specifics */
94#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
95#define _HAVE_UINT64_T
96typedef long long int64_t;
97typedef unsigned long long uint64_t;
98
99#elif !defined __STRICT_ANSI__
100#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
101#define _HAVE_UINT64_T
102typedef __int64 int64_t;
103typedef unsigned __int64 uint64_t;
104
105#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
106/* note: all ELF-systems seem to have loff-support which needs 64-bit */
107#if !defined _NO_LONGLONG
108#define _HAVE_UINT64_T
109typedef long long int64_t;
110typedef unsigned long long uint64_t;
111#endif
112
113#elif defined __alpha || (defined __mips && defined _ABIN32)
114#if !defined _NO_LONGLONG
115typedef long int64_t;
116typedef unsigned long uint64_t;
117#endif
118 /* compiler/cpu type to define int64_t */
119#endif
120#endif
121#endif
122
123#if defined _STDINT_HAVE_U_INT_TYPES
124/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
125typedef u_int8_t uint8_t;
126typedef u_int16_t uint16_t;
127typedef u_int32_t uint32_t;
128
129/* glibc compatibility */
130#ifndef __int8_t_defined
131#define __int8_t_defined
132#endif
133#endif
134
135#ifdef _STDINT_NEED_INT_MODEL_T
136/* we must guess all the basic types. Apart from byte-adressable system, */
137/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
138/* (btw, those nibble-addressable systems are way off, or so we assume) */
139
140
141#if defined _STDINT_BYTE_MODEL
142#if _STDINT_LONG_MODEL+0 == 242
143/* 2:4:2 = IP16 = a normal 16-bit system */
144typedef unsigned char uint8_t;
145typedef unsigned short uint16_t;
146typedef unsigned long uint32_t;
147#ifndef __int8_t_defined
148#define __int8_t_defined
149typedef char int8_t;
150typedef short int16_t;
151typedef long int32_t;
152#endif
153#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
154/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */
155/* 4:4:4 = ILP32 = a normal 32-bit system */
156typedef unsigned char uint8_t;
157typedef unsigned short uint16_t;
158typedef unsigned int uint32_t;
159#ifndef __int8_t_defined
160#define __int8_t_defined
161typedef char int8_t;
162typedef short int16_t;
163typedef int int32_t;
164#endif
165#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
166/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */
167/* 4:8:8 = LP64 = a normal 64-bit system */
168typedef unsigned char uint8_t;
169typedef unsigned short uint16_t;
170typedef unsigned int uint32_t;
171#ifndef __int8_t_defined
172#define __int8_t_defined
173typedef char int8_t;
174typedef short int16_t;
175typedef int int32_t;
176#endif
177/* this system has a "long" of 64bit */
178#ifndef _HAVE_UINT64_T
179#define _HAVE_UINT64_T
180typedef unsigned long uint64_t;
181typedef long int64_t;
182#endif
183#elif _STDINT_LONG_MODEL+0 == 448
184/* LLP64 a 64-bit system derived from a 32-bit system */
185typedef unsigned char uint8_t;
186typedef unsigned short uint16_t;
187typedef unsigned int uint32_t;
188#ifndef __int8_t_defined
189#define __int8_t_defined
190typedef char int8_t;
191typedef short int16_t;
192typedef int int32_t;
193#endif
194/* assuming the system has a "long long" */
195#ifndef _HAVE_UINT64_T
196#define _HAVE_UINT64_T
197typedef unsigned long long uint64_t;
198typedef long long int64_t;
199#endif
200#else
201#define _STDINT_NO_INT32_T
202#endif
203#else
204#define _STDINT_NO_INT8_T
205#define _STDINT_NO_INT32_T
206#endif
207#endif
208
209/*
210 * quote from SunOS-5.8 sys/inttypes.h:
211 * Use at your own risk. As of February 1996, the committee is squarely
212 * behind the fixed sized types; the "least" and "fast" types are still being
213 * discussed. The probability that the "fast" types may be removed before
214 * the standard is finalized is high enough that they are not currently
215 * implemented.
216 */
217
218#if defined _STDINT_NEED_INT_LEAST_T
219typedef int8_t int_least8_t;
220typedef int16_t int_least16_t;
221typedef int32_t int_least32_t;
222#ifdef _HAVE_UINT64_T
223typedef int64_t int_least64_t;
224#endif
225
226typedef uint8_t uint_least8_t;
227typedef uint16_t uint_least16_t;
228typedef uint32_t uint_least32_t;
229#ifdef _HAVE_UINT64_T
230typedef uint64_t uint_least64_t;
231#endif
232 /* least types */
233#endif
234
235#if defined _STDINT_NEED_INT_FAST_T
236typedef int8_t int_fast8_t;
237typedef int int_fast16_t;
238typedef int32_t int_fast32_t;
239#ifdef _HAVE_UINT64_T
240typedef int64_t int_fast64_t;
241#endif
242
243typedef uint8_t uint_fast8_t;
244typedef unsigned uint_fast16_t;
245typedef uint32_t uint_fast32_t;
246#ifdef _HAVE_UINT64_T
247typedef uint64_t uint_fast64_t;
248#endif
249 /* fast types */
250#endif
251
252#ifdef _STDINT_NEED_INTMAX_T
253#ifdef _HAVE_UINT64_T
254typedef int64_t intmax_t;
255typedef uint64_t uintmax_t;
256#else
257typedef long intmax_t;
258typedef unsigned long uintmax_t;
259#endif
260#endif
261
262#ifdef _STDINT_NEED_INTPTR_T
263#ifndef __intptr_t_defined
264#define __intptr_t_defined
265/* we encourage using "long" to store pointer values, never use "int" ! */
266#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
267typedef unsigned int uintptr_t;
268typedef int intptr_t;
269#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
270typedef unsigned long uintptr_t;
271typedef long intptr_t;
272#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
273typedef uint64_t uintptr_t;
274typedef int64_t intptr_t;
275#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
276typedef unsigned long uintptr_t;
277typedef long intptr_t;
278#endif
279#endif
280#endif
281
282 /* shortcircuit*/
283#endif
284 /* once */
285#endif
286#endif
287