Debian Codegraph @

m4/inttypes.m4

raw
1 dnl AC_CHECK_GENERATE_INTTYPES_H (INCLUDE-DIRECTORY)
2 dnl generate a default inttypes.h if the header file does not exist already
3 AC_DEFUN([AC_CHECK_GENERATE_INTTYPES],
4 [rm -f $1/inttypes.h
5 AC_CHECK_HEADER([inttypes.h],[],[AX_CREATE_STDINT_H([$1/inttypes.h])])])
6
7 dnl from http://ac-archive.sourceforge.net/guidod/ax_create_stdint_h.html
8 dnl modified: s/AC_COMPILE_CHECK_SIZEOF/AC_CHECK_SIZEOF/g
9
10 dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
11 dnl
12 dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
13 dnl existence of an include file <stdint.h> that defines a set of
14 dnl typedefs, especially uint8_t,int32_t,uintptr_t.
15 dnl Many older installations will not provide this file, but some will
16 dnl have the very same definitions in <inttypes.h>. In other enviroments
17 dnl we can use the inet-types in <sys/types.h> which would define the
18 dnl typedefs int8_t and u_int8_t respectivly.
19 dnl
20 dnl This macros will create a local "_stdint.h" or the headerfile given as
21 dnl an argument. In many cases that file will just "#include <stdint.h>"
22 dnl or "#include <inttypes.h>", while in other environments it will provide
23 dnl the set of basic 'stdint's definitions/typedefs:
24 dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
25 dnl int_least32_t.. int_fast32_t.. intmax_t
26 dnl which may or may not rely on the definitions of other files,
27 dnl or using the AC_CHECK_SIZEOF macro to determine the actual
28 dnl sizeof each type.
29 dnl
30 dnl if your header files require the stdint-types you will want to create an
31 dnl installable file mylib-int.h that all your other installable header
32 dnl may include. So if you have a library package named "mylib", just use
33 dnl AX_CREATE_STDINT_H(mylib-int.h)
34 dnl in configure.ac and go to install that very header file in Makefile.am
35 dnl along with the other headers (mylib.h) - and the mylib-specific headers
36 dnl can simply use "#include <mylib-int.h>" to obtain the stdint-types.
37 dnl
38 dnl Remember, if the system already had a valid <stdint.h>, the generated
39 dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things...
40 dnl
41 dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/)
42 dnl @version $Id$
43 dnl @author Guido Draheim <[email protected]>
44
45 AC_DEFUN([AX_CREATE_STDINT_H],
46 [# ------ AX CREATE STDINT H -------------------------------------
47 AC_MSG_CHECKING([for stdint types])
48 ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
49 # try to shortcircuit - if the default include path of the compiler
50 # can find a "stdint.h" header then we assume that all compilers can.
51 AC_CACHE_VAL([ac_cv_header_stdint_t],[
52 old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
53 old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
54 old_CFLAGS="$CFLAGS" ; CFLAGS=""
55 AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
56 [ac_cv_stdint_result="(assuming C99 compatible system)"
57 ac_cv_header_stdint_t="stdint.h"; ],
58 [ac_cv_header_stdint_t=""])
59 CXXFLAGS="$old_CXXFLAGS"
60 CPPFLAGS="$old_CPPFLAGS"
61 CFLAGS="$old_CFLAGS" ])
62
63 v="... $ac_cv_header_stdint_h"
64 if test "$ac_stdint_h" = "stdint.h" ; then
65 AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
66 elif test "$ac_stdint_h" = "inttypes.h" ; then
67 AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
68 elif test "_$ac_cv_header_stdint_t" = "_" ; then
69 AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
70 else
71 ac_cv_header_stdint="$ac_cv_header_stdint_t"
72 AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
73 fi
74
75 if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
76
77 dnl .....intro message done, now do a few system checks.....
78 dnl btw, all CHECK_TYPE macros do automatically "DEFINE" a type, therefore
79 dnl we use the autoconf implementation detail _AC CHECK_TYPE_NEW instead
80
81 inttype_headers=`echo $2 | sed -e 's/,/ /g'`
82
83 ac_cv_stdint_result="(no helpful system typedefs seen)"
84 AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
85 ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
86 AC_MSG_RESULT([(..)])
87 for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers ; do
88 unset ac_cv_type_uintptr_t
89 unset ac_cv_type_uint64_t
90 _AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl
91 continue,[#include <$i>])
92 AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
93 ac_cv_stdint_result="(seen uintptr_t$and64 in $i)"
94 break;
95 done
96 AC_MSG_CHECKING([for stdint uintptr_t])
97 ])
98
99 if test "_$ac_cv_header_stdint_x" = "_" ; then
100 AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
101 ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
102 AC_MSG_RESULT([(..)])
103 for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers ; do
104 unset ac_cv_type_uint32_t
105 unset ac_cv_type_uint64_t
106 AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl
107 continue,[#include <$i>])
108 AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
109 ac_cv_stdint_result="(seen uint32_t$and64 in $i)"
110 break;
111 done
112 AC_MSG_CHECKING([for stdint uint32_t])
113 ])
114 fi
115
116 if test "_$ac_cv_header_stdint_x" = "_" ; then
117 if test "_$ac_cv_header_stdint_o" = "_" ; then
118 AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
119 ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
120 AC_MSG_RESULT([(..)])
121 for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do
122 unset ac_cv_type_u_int32_t
123 unset ac_cv_type_u_int64_t
124 AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl
125 continue,[#include <$i>])
126 AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
127 ac_cv_stdint_result="(seen u_int32_t$and64 in $i)"
128 break;
129 done
130 AC_MSG_CHECKING([for stdint u_int32_t])
131 ])
132 fi fi
133
134 dnl if there was no good C99 header file, do some typedef checks...
135 if test "_$ac_cv_header_stdint_x" = "_" ; then
136 AC_MSG_CHECKING([for stdint datatype model])
137 AC_MSG_RESULT([(..)])
138 AC_CHECK_SIZEOF(char)
139 AC_CHECK_SIZEOF(short)
140 AC_CHECK_SIZEOF(int)
141 AC_CHECK_SIZEOF(long)
142 AC_CHECK_SIZEOF(void*)
143 ac_cv_stdint_char_model=""
144 ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_char"
145 ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_short"
146 ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_int"
147 ac_cv_stdint_long_model=""
148 ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_int"
149 ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_long"
150 ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_voidp"
151 name="$ac_cv_stdint_long_model"
152 case "$ac_cv_stdint_char_model/$ac_cv_stdint_long_model" in
153 122/242) name="$name, IP16 (standard 16bit machine)" ;;
154 122/244) name="$name, LP32 (standard 32bit mac/win)" ;;
155 122/*) name="$name (unusual int16 model)" ;;
156 124/444) name="$name, ILP32 (standard 32bit unixish)" ;;
157 124/488) name="$name, LP64 (standard 64bit unixish)" ;;
158 124/448) name="$name, LLP64 (unusual 64bit unixish)" ;;
159 124/*) name="$name (unusual int32 model)" ;;
160 128/888) name="$name, ILP64 (unusual 64bit numeric)" ;;
161 128/*) name="$name (unusual int64 model)" ;;
162 222/*|444/*) name="$name (unusual dsptype)" ;;
163 *) name="$name (very unusal model)" ;;
164 esac
165 AC_MSG_RESULT([combined for stdint datatype model... $name])
166 fi
167
168 if test "_$ac_cv_header_stdint_x" != "_" ; then
169 ac_cv_header_stdint="$ac_cv_header_stdint_x"
170 elif test "_$ac_cv_header_stdint_o" != "_" ; then
171 ac_cv_header_stdint="$ac_cv_header_stdint_o"
172 elif test "_$ac_cv_header_stdint_u" != "_" ; then
173 ac_cv_header_stdint="$ac_cv_header_stdint_u"
174 else
175 ac_cv_header_stdint="stddef.h"
176 fi
177
178 AC_MSG_CHECKING([for extra inttypes in chosen header])
179 AC_MSG_RESULT([($ac_cv_header_stdint)])
180 dnl see if int_least and int_fast types are present in _this_ header.
181 unset ac_cv_type_int_least32_t
182 unset ac_cv_type_int_fast32_t
183 AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
184 AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
185 AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
186
187 fi # shortcircut to system "stdint.h"
188 # ------------------ PREPARE VARIABLES ------------------------------
189 if test "$GCC" = "yes" ; then
190 ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1`
191 else
192 ac_cv_stdint_message="using $CC"
193 fi
194
195 AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
196 $ac_cv_stdint_result])
197
198 # ----------------- DONE inttypes.h checks START header -------------
199 AC_CONFIG_COMMANDS([$ac_stdint_h],[
200 AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
201 ac_stdint=$tmp/_stdint.h
202
203 echo "#ifndef" $_ac_stdint_h >$ac_stdint
204 echo "#define" $_ac_stdint_h "1" >>$ac_stdint
205 echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
206 echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
207 echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
208 if test "_$ac_cv_header_stdint_t" != "_" ; then
209 echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
210 fi
211
212 cat >>$ac_stdint <<STDINT_EOF
213
214 /* ................... shortcircuit part ........................... */
215
216 #if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
217 #include <stdint.h>
218 #else
219 #include <stddef.h>
220
221 /* .................... configured part ............................ */
222
223 STDINT_EOF
224
225 echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
226 if test "_$ac_cv_header_stdint_x" != "_" ; then
227 ac_header="$ac_cv_header_stdint_x"
228 echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
229 else
230 echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
231 fi
232
233 echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
234 if test "_$ac_cv_header_stdint_o" != "_" ; then
235 ac_header="$ac_cv_header_stdint_o"
236 echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
237 else
238 echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
239 fi
240
241 echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
242 if test "_$ac_cv_header_stdint_u" != "_" ; then
243 ac_header="$ac_cv_header_stdint_u"
244 echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
245 else
246 echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
247 fi
248
249 echo "" >>$ac_stdint
250
251 if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
252 echo "#include <$ac_header>" >>$ac_stdint
253 echo "" >>$ac_stdint
254 fi fi
255
256 echo "/* which 64bit typedef has been found */" >>$ac_stdint
257 if test "$ac_cv_type_uint64_t" = "yes" ; then
258 echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint
259 else
260 echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
261 fi
262 if test "$ac_cv_type_u_int64_t" = "yes" ; then
263 echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint
264 else
265 echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
266 fi
267 echo "" >>$ac_stdint
268
269 echo "/* which type model has been detected */" >>$ac_stdint
270 if test "_$ac_cv_stdint_char_model" != "_" ; then
271 echo "#define _STDINT_CHAR_MODEL" "$ac_cv_stdint_char_model" >>$ac_stdint
272 echo "#define _STDINT_LONG_MODEL" "$ac_cv_stdint_long_model" >>$ac_stdint
273 else
274 echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
275 echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
276 fi
277 echo "" >>$ac_stdint
278
279 echo "/* whether int_least types were detected */" >>$ac_stdint
280 if test "$ac_cv_type_int_least32_t" = "yes"; then
281 echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint
282 else
283 echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
284 fi
285 echo "/* whether int_fast types were detected */" >>$ac_stdint
286 if test "$ac_cv_type_int_fast32_t" = "yes"; then
287 echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
288 else
289 echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
290 fi
291 echo "/* whether intmax_t type was detected */" >>$ac_stdint
292 if test "$ac_cv_type_intmax_t" = "yes"; then
293 echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
294 else
295 echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
296 fi
297 echo "" >>$ac_stdint
298
299 cat >>$ac_stdint <<STDINT_EOF
300 /* .................... detections part ............................ */
301
302 /* whether we need to define bitspecific types from compiler base types */
303 #ifndef _STDINT_HEADER_INTPTR
304 #ifndef _STDINT_HEADER_UINT32
305 #ifndef _STDINT_HEADER_U_INT32
306 #define _STDINT_NEED_INT_MODEL_T
307 #else
308 #define _STDINT_HAVE_U_INT_TYPES
309 #endif
310 #endif
311 #endif
312
313 #ifdef _STDINT_HAVE_U_INT_TYPES
314 #undef _STDINT_NEED_INT_MODEL_T
315 #endif
316
317 #ifdef _STDINT_CHAR_MODEL
318 #if _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
319 #ifndef _STDINT_BYTE_MODEL
320 #define _STDINT_BYTE_MODEL 12
321 #endif
322 #endif
323 #endif
324
325 #ifndef _STDINT_HAVE_INT_LEAST32_T
326 #define _STDINT_NEED_INT_LEAST_T
327 #endif
328
329 #ifndef _STDINT_HAVE_INT_FAST32_T
330 #define _STDINT_NEED_INT_FAST_T
331 #endif
332
333 #ifndef _STDINT_HEADER_INTPTR
334 #define _STDINT_NEED_INTPTR_T
335 #ifndef _STDINT_HAVE_INTMAX_T
336 #define _STDINT_NEED_INTMAX_T
337 #endif
338 #endif
339
340
341 /* .................... definition part ............................ */
342
343 /* some system headers have good uint64_t */
344 #ifndef _HAVE_UINT64_T
345 #if defined _STDINT_HAVE_UINT64_T || defined HAVE_UINT64_T
346 #define _HAVE_UINT64_T
347 #elif defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
348 #define _HAVE_UINT64_T
349 typedef u_int64_t uint64_t;
350 #endif
351 #endif
352
353 #ifndef _HAVE_UINT64_T
354 /* .. here are some common heuristics using compiler runtime specifics */
355 #if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
356 #define _HAVE_UINT64_T
357 typedef long long int64_t;
358 typedef unsigned long long uint64_t;
359
360 #elif !defined __STRICT_ANSI__
361 #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
362 #define _HAVE_UINT64_T
363 typedef __int64 int64_t;
364 typedef unsigned __int64 uint64_t;
365
366 #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
367 /* note: all ELF-systems seem to have loff-support which needs 64-bit */
368 #if !defined _NO_LONGLONG
369 #define _HAVE_UINT64_T
370 typedef long long int64_t;
371 typedef unsigned long long uint64_t;
372 #endif
373
374 #elif defined __alpha || (defined __mips && defined _ABIN32)
375 #if !defined _NO_LONGLONG
376 typedef long int64_t;
377 typedef unsigned long uint64_t;
378 #endif
379 /* compiler/cpu type to define int64_t */
380 #endif
381 #endif
382 #endif
383
384 #if defined _STDINT_HAVE_U_INT_TYPES
385 /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
386 typedef u_int8_t uint8_t;
387 typedef u_int16_t uint16_t;
388 typedef u_int32_t uint32_t;
389
390 /* glibc compatibility */
391 #ifndef __int8_t_defined
392 #define __int8_t_defined
393 #endif
394 #endif
395
396 #ifdef _STDINT_NEED_INT_MODEL_T
397 /* we must guess all the basic types. Apart from byte-adressable system, */
398 /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
399 /* (btw, those nibble-addressable systems are way off, or so we assume) */
400
401 dnl /* have a look at "64bit and data size neutrality" at */
402 dnl /* http://unix.org/version2/whatsnew/login_64bit.html */
403 dnl /* (the shorthand "ILP" types always have a "P" part) */
404
405 #if defined _STDINT_BYTE_MODEL
406 #if _STDINT_LONG_MODEL+0 == 242
407 /* 2:4:2 = IP16 = a normal 16-bit system */
408 typedef unsigned char uint8_t;
409 typedef unsigned short uint16_t;
410 typedef unsigned long uint32_t;
411 #ifndef __int8_t_defined
412 #define __int8_t_defined
413 typedef char int8_t;
414 typedef short int16_t;
415 typedef long int32_t;
416 #endif
417 #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
418 /* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */
419 /* 4:4:4 = ILP32 = a normal 32-bit system */
420 typedef unsigned char uint8_t;
421 typedef unsigned short uint16_t;
422 typedef unsigned int uint32_t;
423 #ifndef __int8_t_defined
424 #define __int8_t_defined
425 typedef char int8_t;
426 typedef short int16_t;
427 typedef int int32_t;
428 #endif
429 #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
430 /* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */
431 /* 4:8:8 = LP64 = a normal 64-bit system */
432 typedef unsigned char uint8_t;
433 typedef unsigned short uint16_t;
434 typedef unsigned int uint32_t;
435 #ifndef __int8_t_defined
436 #define __int8_t_defined
437 typedef char int8_t;
438 typedef short int16_t;
439 typedef int int32_t;
440 #endif
441 /* this system has a "long" of 64bit */
442 #ifndef _HAVE_UINT64_T
443 #define _HAVE_UINT64_T
444 typedef unsigned long uint64_t;
445 typedef long int64_t;
446 #endif
447 #elif _STDINT_LONG_MODEL+0 == 448
448 /* LLP64 a 64-bit system derived from a 32-bit system */
449 typedef unsigned char uint8_t;
450 typedef unsigned short uint16_t;
451 typedef unsigned int uint32_t;
452 #ifndef __int8_t_defined
453 #define __int8_t_defined
454 typedef char int8_t;
455 typedef short int16_t;
456 typedef int int32_t;
457 #endif
458 /* assuming the system has a "long long" */
459 #ifndef _HAVE_UINT64_T
460 #define _HAVE_UINT64_T
461 typedef unsigned long long uint64_t;
462 typedef long long int64_t;
463 #endif
464 #else
465 #define _STDINT_NO_INT32_T
466 #endif
467 #else
468 #define _STDINT_NO_INT8_T
469 #define _STDINT_NO_INT32_T
470 #endif
471 #endif
472
473 /*
474 * quote from SunOS-5.8 sys/inttypes.h:
475 * Use at your own risk. As of February 1996, the committee is squarely
476 * behind the fixed sized types; the "least" and "fast" types are still being
477 * discussed. The probability that the "fast" types may be removed before
478 * the standard is finalized is high enough that they are not currently
479 * implemented.
480 */
481
482 #if defined _STDINT_NEED_INT_LEAST_T
483 typedef int8_t int_least8_t;
484 typedef int16_t int_least16_t;
485 typedef int32_t int_least32_t;
486 #ifdef _HAVE_UINT64_T
487 typedef int64_t int_least64_t;
488 #endif
489
490 typedef uint8_t uint_least8_t;
491 typedef uint16_t uint_least16_t;
492 typedef uint32_t uint_least32_t;
493 #ifdef _HAVE_UINT64_T
494 typedef uint64_t uint_least64_t;
495 #endif
496 /* least types */
497 #endif
498
499 #if defined _STDINT_NEED_INT_FAST_T
500 typedef int8_t int_fast8_t;
501 typedef int int_fast16_t;
502 typedef int32_t int_fast32_t;
503 #ifdef _HAVE_UINT64_T
504 typedef int64_t int_fast64_t;
505 #endif
506
507 typedef uint8_t uint_fast8_t;
508 typedef unsigned uint_fast16_t;
509 typedef uint32_t uint_fast32_t;
510 #ifdef _HAVE_UINT64_T
511 typedef uint64_t uint_fast64_t;
512 #endif
513 /* fast types */
514 #endif
515
516 #ifdef _STDINT_NEED_INTMAX_T
517 #ifdef _HAVE_UINT64_T
518 typedef int64_t intmax_t;
519 typedef uint64_t uintmax_t;
520 #else
521 typedef long intmax_t;
522 typedef unsigned long uintmax_t;
523 #endif
524 #endif
525
526 #ifdef _STDINT_NEED_INTPTR_T
527 #ifndef __intptr_t_defined
528 #define __intptr_t_defined
529 /* we encourage using "long" to store pointer values, never use "int" ! */
530 #if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
531 typedef unsinged int uintptr_t;
532 typedef int intptr_t;
533 #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
534 typedef unsigned long uintptr_t;
535 typedef long intptr_t;
536 #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
537 typedef uint64_t uintptr_t;
538 typedef int64_t intptr_t;
539 #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
540 typedef unsigned long uintptr_t;
541 typedef long intptr_t;
542 #endif
543 #endif
544 #endif
545
546 /* shortcircuit*/
547 #endif
548 /* once */
549 #endif
550 #endif
551 STDINT_EOF
552 if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
553 AC_MSG_NOTICE([$ac_stdint_h is unchanged])
554 else
555 ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
556 AS_MKDIR_P(["$ac_dir"])
557 rm -f $ac_stdint_h
558 mv $ac_stdint $ac_stdint_h
559 fi
560 ],[# variables for create stdint.h replacement
561 PACKAGE="$PACKAGE"
562 VERSION="$VERSION"
563 ac_stdint_h="$ac_stdint_h"
564 _ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
565 ac_cv_stdint_message="$ac_cv_stdint_message"
566 ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
567 ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
568 ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
569 ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
570 ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
571 ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
572 ac_cv_stdint_char_model="$ac_cv_stdint_char_model"
573 ac_cv_stdint_long_model="$ac_cv_stdint_long_model"
574 ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
575 ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
576 ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
577 ])
578 ])