1 dnl AC_NEED_STDINT_H ( HEADER-TO-GENERATE )
3 dnl Look for a header file that defines size-specific integer types like the
4 dnl ones recommended to be in stdint.h in the C99 standard (e.g. uint32_t).
6 dnl AX_CHECK_DEFINED_TYPE ( TYPE, FILE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND )
7 dnl This is similar to _AC_CHECK_TYPE_NEW (a.k.a. new syntax version of
8 dnl AC_CHECK_TYPE) in autoconf 2.50 but works on older versions
9 AC_DEFUN([AX_CHECK_DEFINED_TYPE],
10 [AC_MSG_CHECKING([for $1 in $2])
11 AC_EGREP_CPP(changequote(<<,>>)dnl
12 <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
13 changequote([,]), [#include <$2>],
14 ac_cv_type_$1=yes, ac_cv_type_$1=no)dnl
15 AC_MSG_RESULT($ac_cv_type_$1)
16 if test $ac_cv_type_$1 = yes; then
23 dnl Look for a header file that defines size-specific integer types
24 AC_DEFUN([AX_NEED_STDINT_H],
27 ac_dir=`echo "$1"|sed 's%/[^/][^/]*$%%'`
29 if test "$ac_dir" != "$1" && test "$ac_dir" != .; then
30 # The file is in a subdirectory.
31 test ! -d "$ac_dir" && mkdir "$ac_dir"
34 AX_CHECK_DEFINED_TYPE(uint8_t,
38 /* This file is generated automatically by configure */
41 [AX_CHECK_DEFINED_TYPE(uint8_t,
44 /* This file is generated automatically by configure */
47 [AX_CHECK_DEFINED_TYPE(uint8_t,
50 /* This file is generated automatically by configure */
51 #include <sys/types.h>
53 [AX_CHECK_DEFINED_TYPE(u_int8_t,
56 /* This file is generated automatically by configure */
59 #include <sys/types.h>
60 typedef u_int8_t uint8_t;
61 typedef u_int16_t uint16_t;
62 typedef u_int32_t uint32_t;
65 AX_CHECK_DEFINED_TYPE(u_int64_t,
68 typedef u_int64_t uint64_t;
69 #endif /*!__STDINT_H*/
72 /* 64-bit types are not available on this system */
73 /* typedef u_int64_t uint64_t; */
74 #endif /*!__STDINT_H*/
78 [AC_MSG_WARN([I can't find size-specific integer definitions on this system])
79 if test -e "$1" ; then
85 AC_DEFUN([AX_CHECK_DATA_MODEL],[
87 AC_CHECK_SIZEOF(short)
90 AC_CHECK_SIZEOF(void*)
91 ac_cv_char_data_model=""
92 ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
93 ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
94 ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
95 ac_cv_long_data_model=""
96 ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
97 ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
98 ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
99 AC_MSG_CHECKING([data model])
100 case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
101 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;;
102 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;;
103 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;;
104 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
105 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;;
106 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
107 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;;
108 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
109 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;;
110 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
111 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
112 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
113 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
114 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
115 222/*|333/*|444/*|666/*|888/*) :
116 ac_cv_data_model="iDSP" ; n="unusual dsptype" ;;
117 *) ac_cv_data_model="none" ; n="very unusual model" ;;
119 AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)])
122 dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF])
123 AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
124 AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
125 ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
126 AC_MSG_RESULT([(..)])
127 for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do
128 unset ac_cv_type_uintptr_t
129 unset ac_cv_type_uint64_t
130 AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
131 AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
132 m4_ifvaln([$1],[$1]) break
134 AC_MSG_CHECKING([for stdint uintptr_t])
138 AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
139 AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
140 ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
141 AC_MSG_RESULT([(..)])
142 for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do
143 unset ac_cv_type_uint32_t
144 unset ac_cv_type_uint64_t
145 AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
146 AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
147 m4_ifvaln([$1],[$1]) break
150 AC_MSG_CHECKING([for stdint uint32_t])
154 AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[
155 AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
156 ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
157 AC_MSG_RESULT([(..)])
158 for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do
159 unset ac_cv_type_u_int32_t
160 unset ac_cv_type_u_int64_t
161 AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>])
162 AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
163 m4_ifvaln([$1],[$1]) break
166 AC_MSG_CHECKING([for stdint u_int32_t])
170 AC_DEFUN([AX_CREATE_STDINT_H],
171 [# ------ AX CREATE STDINT H -------------------------------------
172 AC_MSG_CHECKING([for stdint types])
173 ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
174 # try to shortcircuit - if the default include path of the compiler
175 # can find a "stdint.h" header then we assume that all compilers can.
176 AC_CACHE_VAL([ac_cv_header_stdint_t],[
177 old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
178 old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
179 old_CFLAGS="$CFLAGS" ; CFLAGS=""
180 AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
181 [ac_cv_stdint_result="(assuming C99 compatible system)"
182 ac_cv_header_stdint_t="stdint.h"; ],
183 [ac_cv_header_stdint_t=""])
184 CXXFLAGS="$old_CXXFLAGS"
185 CPPFLAGS="$old_CPPFLAGS"
186 CFLAGS="$old_CFLAGS" ])
188 v="... $ac_cv_header_stdint_h"
189 if test "$ac_stdint_h" = "stdint.h" ; then
190 AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
191 elif test "$ac_stdint_h" = "inttypes.h" ; then
192 AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
193 elif test "_$ac_cv_header_stdint_t" = "_" ; then
194 AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
196 ac_cv_header_stdint="$ac_cv_header_stdint_t"
197 AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
200 if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
202 dnl .....intro message done, now do a few system checks.....
203 dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type,
204 dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW
205 dnl instead that is triggered with 3 or more arguments (see types.m4)
207 inttype_headers=`echo $2 | sed -e 's/,/ /g'`
209 ac_cv_stdint_result="(no helpful system typedefs seen)"
210 AX_CHECK_HEADER_STDINT_X(dnl
211 stdint.h inttypes.h sys/inttypes.h $inttype_headers,
212 ac_cv_stdint_result="(seen uintptr_t$and64 in $i)")
214 if test "_$ac_cv_header_stdint_x" = "_" ; then
215 AX_CHECK_HEADER_STDINT_O(dnl,
216 inttypes.h sys/inttypes.h stdint.h $inttype_headers,
217 ac_cv_stdint_result="(seen uint32_t$and64 in $i)")
220 if test "_$ac_cv_header_stdint_x" = "_" ; then
221 if test "_$ac_cv_header_stdint_o" = "_" ; then
222 AX_CHECK_HEADER_STDINT_U(dnl,
223 sys/types.h inttypes.h sys/inttypes.h $inttype_headers,
224 ac_cv_stdint_result="(seen u_int32_t$and64 in $i)")
227 dnl if there was no good C99 header file, do some typedef checks...
228 if test "_$ac_cv_header_stdint_x" = "_" ; then
229 AC_MSG_CHECKING([for stdint datatype model])
230 AC_MSG_RESULT([(..)])
234 if test "_$ac_cv_header_stdint_x" != "_" ; then
235 ac_cv_header_stdint="$ac_cv_header_stdint_x"
236 elif test "_$ac_cv_header_stdint_o" != "_" ; then
237 ac_cv_header_stdint="$ac_cv_header_stdint_o"
238 elif test "_$ac_cv_header_stdint_u" != "_" ; then
239 ac_cv_header_stdint="$ac_cv_header_stdint_u"
241 ac_cv_header_stdint="stddef.h"
244 AC_MSG_CHECKING([for extra inttypes in chosen header])
245 AC_MSG_RESULT([($ac_cv_header_stdint)])
246 dnl see if int_least and int_fast types are present in _this_ header.
247 unset ac_cv_type_int_least32_t
248 unset ac_cv_type_int_fast32_t
249 AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
250 AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
251 AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
253 fi # shortcircut to system "stdint.h"
254 # ------------------ PREPARE VARIABLES ------------------------------
255 if test "$GCC" = "yes" ; then
256 ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1`
258 ac_cv_stdint_message="using $CC"
261 AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
262 $ac_cv_stdint_result])
264 dnl -----------------------------------------------------------------
265 # ----------------- DONE inttypes.h checks START header -------------
266 AC_CONFIG_COMMANDS([$ac_stdint_h],[
267 AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
268 ac_stdint=$tmp/_stdint.h
270 echo "#ifndef" $_ac_stdint_h >$ac_stdint
271 echo "#define" $_ac_stdint_h "1" >>$ac_stdint
272 echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
273 echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
274 echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
275 if test "_$ac_cv_header_stdint_t" != "_" ; then
276 echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
277 echo "#include <stdint.h>" >>$ac_stdint
278 echo "#endif" >>$ac_stdint
279 echo "#endif" >>$ac_stdint
282 cat >>$ac_stdint <<STDINT_EOF
284 /* ................... shortcircuit part ........................... */
286 #if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
291 /* .................... configured part ............................ */
295 echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
296 if test "_$ac_cv_header_stdint_x" != "_" ; then
297 ac_header="$ac_cv_header_stdint_x"
298 echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
300 echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
303 echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
304 if test "_$ac_cv_header_stdint_o" != "_" ; then
305 ac_header="$ac_cv_header_stdint_o"
306 echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
308 echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
311 echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
312 if test "_$ac_cv_header_stdint_u" != "_" ; then
313 ac_header="$ac_cv_header_stdint_u"
314 echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
316 echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
321 if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
322 echo "#include <$ac_header>" >>$ac_stdint
326 echo "/* which 64bit typedef has been found */" >>$ac_stdint
327 if test "$ac_cv_type_uint64_t" = "yes" ; then
328 echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint
330 echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
332 if test "$ac_cv_type_u_int64_t" = "yes" ; then
333 echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint
335 echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
339 echo "/* which type model has been detected */" >>$ac_stdint
340 if test "_$ac_cv_char_data_model" != "_" ; then
341 echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
342 echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
344 echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
345 echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
349 echo "/* whether int_least types were detected */" >>$ac_stdint
350 if test "$ac_cv_type_int_least32_t" = "yes"; then
351 echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint
353 echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
355 echo "/* whether int_fast types were detected */" >>$ac_stdint
356 if test "$ac_cv_type_int_fast32_t" = "yes"; then
357 echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
359 echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
361 echo "/* whether intmax_t type was detected */" >>$ac_stdint
362 if test "$ac_cv_type_intmax_t" = "yes"; then
363 echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
365 echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
369 cat >>$ac_stdint <<STDINT_EOF
370 /* .................... detections part ............................ */
372 /* whether we need to define bitspecific types from compiler base types */
373 #ifndef _STDINT_HEADER_INTPTR
374 #ifndef _STDINT_HEADER_UINT32
375 #ifndef _STDINT_HEADER_U_INT32
376 #define _STDINT_NEED_INT_MODEL_T
378 #define _STDINT_HAVE_U_INT_TYPES
383 #ifdef _STDINT_HAVE_U_INT_TYPES
384 #undef _STDINT_NEED_INT_MODEL_T
387 #ifdef _STDINT_CHAR_MODEL
388 #if _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
389 #ifndef _STDINT_BYTE_MODEL
390 #define _STDINT_BYTE_MODEL 12
395 #ifndef _STDINT_HAVE_INT_LEAST32_T
396 #define _STDINT_NEED_INT_LEAST_T
399 #ifndef _STDINT_HAVE_INT_FAST32_T
400 #define _STDINT_NEED_INT_FAST_T
403 #ifndef _STDINT_HEADER_INTPTR
404 #define _STDINT_NEED_INTPTR_T
405 #ifndef _STDINT_HAVE_INTMAX_T
406 #define _STDINT_NEED_INTMAX_T
411 /* .................... definition part ............................ */
413 /* some system headers have good uint64_t */
414 #ifndef _HAVE_UINT64_T
415 #if defined _STDINT_HAVE_UINT64_T || defined HAVE_UINT64_T
416 #define _HAVE_UINT64_T
417 #elif defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
418 #define _HAVE_UINT64_T
419 typedef u_int64_t uint64_t;
423 #ifndef _HAVE_UINT64_T
424 /* .. here are some common heuristics using compiler runtime specifics */
425 #if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
426 #define _HAVE_UINT64_T
427 #define _HAVE_LONGLONG_UINT64_T
428 typedef long long int64_t;
429 typedef unsigned long long uint64_t;
431 #elif !defined __STRICT_ANSI__
432 #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
433 #define _HAVE_UINT64_T
434 typedef __int64 int64_t;
435 typedef unsigned __int64 uint64_t;
437 #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
438 /* note: all ELF-systems seem to have loff-support which needs 64-bit */
439 #if !defined _NO_LONGLONG
440 #define _HAVE_UINT64_T
441 #define _HAVE_LONGLONG_UINT64_T
442 typedef long long int64_t;
443 typedef unsigned long long uint64_t;
446 #elif defined __alpha || (defined __mips && defined _ABIN32)
447 #if !defined _NO_LONGLONG
448 typedef long int64_t;
449 typedef unsigned long uint64_t;
451 /* compiler/cpu type to define int64_t */
456 #if defined _STDINT_HAVE_U_INT_TYPES
457 /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
458 typedef u_int8_t uint8_t;
459 typedef u_int16_t uint16_t;
460 typedef u_int32_t uint32_t;
462 /* glibc compatibility */
463 #ifndef __int8_t_defined
464 #define __int8_t_defined
468 #ifdef _STDINT_NEED_INT_MODEL_T
469 /* we must guess all the basic types. Apart from byte-adressable system, */
470 /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
471 /* (btw, those nibble-addressable systems are way off, or so we assume) */
473 dnl /* have a look at "64bit and data size neutrality" at */
474 dnl /* http://unix.org/version2/whatsnew/login_64bit.html */
475 dnl /* (the shorthand "ILP" types always have a "P" part) */
477 #if defined _STDINT_BYTE_MODEL
478 #if _STDINT_LONG_MODEL+0 == 242
479 /* 2:4:2 = IP16 = a normal 16-bit system */
480 typedef unsigned char uint8_t;
481 typedef unsigned short uint16_t;
482 typedef unsigned long uint32_t;
483 #ifndef __int8_t_defined
484 #define __int8_t_defined
486 typedef short int16_t;
487 typedef long int32_t;
489 #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
490 /* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */
491 /* 4:4:4 = ILP32 = a normal 32-bit system */
492 typedef unsigned char uint8_t;
493 typedef unsigned short uint16_t;
494 typedef unsigned int uint32_t;
495 #ifndef __int8_t_defined
496 #define __int8_t_defined
498 typedef short int16_t;
501 #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
502 /* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */
503 /* 4:8:8 = LP64 = a normal 64-bit system */
504 typedef unsigned char uint8_t;
505 typedef unsigned short uint16_t;
506 typedef unsigned int uint32_t;
507 #ifndef __int8_t_defined
508 #define __int8_t_defined
510 typedef short int16_t;
513 /* this system has a "long" of 64bit */
514 #ifndef _HAVE_UINT64_T
515 #define _HAVE_UINT64_T
516 typedef unsigned long uint64_t;
517 typedef long int64_t;
519 #elif _STDINT_LONG_MODEL+0 == 448
520 /* LLP64 a 64-bit system derived from a 32-bit system */
521 typedef unsigned char uint8_t;
522 typedef unsigned short uint16_t;
523 typedef unsigned int uint32_t;
524 #ifndef __int8_t_defined
525 #define __int8_t_defined
527 typedef short int16_t;
530 /* assuming the system has a "long long" */
531 #ifndef _HAVE_UINT64_T
532 #define _HAVE_UINT64_T
533 #define _HAVE_LONGLONG_UINT64_T
534 typedef unsigned long long uint64_t;
535 typedef long long int64_t;
538 #define _STDINT_NO_INT32_T
541 #define _STDINT_NO_INT8_T
542 #define _STDINT_NO_INT32_T
547 * quote from SunOS-5.8 sys/inttypes.h:
548 * Use at your own risk. As of February 1996, the committee is squarely
549 * behind the fixed sized types; the "least" and "fast" types are still being
550 * discussed. The probability that the "fast" types may be removed before
551 * the standard is finalized is high enough that they are not currently
555 #if defined _STDINT_NEED_INT_LEAST_T
556 typedef int8_t int_least8_t;
557 typedef int16_t int_least16_t;
558 typedef int32_t int_least32_t;
559 #ifdef _HAVE_UINT64_T
560 typedef int64_t int_least64_t;
563 typedef uint8_t uint_least8_t;
564 typedef uint16_t uint_least16_t;
565 typedef uint32_t uint_least32_t;
566 #ifdef _HAVE_UINT64_T
567 typedef uint64_t uint_least64_t;
572 #if defined _STDINT_NEED_INT_FAST_T
573 typedef int8_t int_fast8_t;
574 typedef int int_fast16_t;
575 typedef int32_t int_fast32_t;
576 #ifdef _HAVE_UINT64_T
577 typedef int64_t int_fast64_t;
580 typedef uint8_t uint_fast8_t;
581 typedef unsigned uint_fast16_t;
582 typedef uint32_t uint_fast32_t;
583 #ifdef _HAVE_UINT64_T
584 typedef uint64_t uint_fast64_t;
589 #ifdef _STDINT_NEED_INTMAX_T
590 #ifdef _HAVE_UINT64_T
591 typedef int64_t intmax_t;
592 typedef uint64_t uintmax_t;
594 typedef long intmax_t;
595 typedef unsigned long uintmax_t;
599 #ifdef _STDINT_NEED_INTPTR_T
600 #ifndef __intptr_t_defined
601 #define __intptr_t_defined
602 /* we encourage using "long" to store pointer values, never use "int" ! */
603 #if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
604 typedef unsinged int uintptr_t;
605 typedef int intptr_t;
606 #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
607 typedef unsigned long uintptr_t;
608 typedef long intptr_t;
609 #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
610 typedef uint64_t uintptr_t;
611 typedef int64_t intptr_t;
612 #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
613 typedef unsigned long uintptr_t;
614 typedef long intptr_t;
619 /* The ISO C99 standard specifies that in C++ implementations these
620 should only be defined if explicitly requested. */
621 #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
626 # define INT16_C(c) c
627 # define INT32_C(c) c
628 # ifdef _HAVE_LONGLONG_UINT64_T
629 # define INT64_C(c) c ## L
631 # define INT64_C(c) c ## LL
635 # define UINT8_C(c) c ## U
636 # define UINT16_C(c) c ## U
637 # define UINT32_C(c) c ## U
638 # ifdef _HAVE_LONGLONG_UINT64_T
639 # define UINT64_C(c) c ## UL
641 # define UINT64_C(c) c ## ULL
645 # ifdef _HAVE_LONGLONG_UINT64_T
646 # define INTMAX_C(c) c ## L
647 # define UINTMAX_C(c) c ## UL
649 # define INTMAX_C(c) c ## LL
650 # define UINTMAX_C(c) c ## ULL
657 /* These limits are merily those of a two complement byte-oriented system */
659 /* Minimum of signed integral types. */
660 # define INT8_MIN (-128)
661 # define INT16_MIN (-32767-1)
662 # define INT32_MIN (-2147483647-1)
663 # define INT64_MIN (-__INT64_C(9223372036854775807)-1)
664 /* Maximum of signed integral types. */
665 # define INT8_MAX (127)
666 # define INT16_MAX (32767)
667 # define INT32_MAX (2147483647)
668 # define INT64_MAX (__INT64_C(9223372036854775807))
670 /* Maximum of unsigned integral types. */
671 # define UINT8_MAX (255)
672 # define UINT16_MAX (65535)
673 # define UINT32_MAX (4294967295U)
674 # define UINT64_MAX (__UINT64_C(18446744073709551615))
676 /* Minimum of signed integral types having a minimum size. */
677 # define INT_LEAST8_MIN INT8_MIN
678 # define INT_LEAST16_MIN INT16_MIN
679 # define INT_LEAST32_MIN INT32_MIN
680 # define INT_LEAST64_MIN INT64_MIN
681 /* Maximum of signed integral types having a minimum size. */
682 # define INT_LEAST8_MAX INT8_MAX
683 # define INT_LEAST16_MAX INT16_MAX
684 # define INT_LEAST32_MAX INT32_MAX
685 # define INT_LEAST64_MAX INT64_MAX
687 /* Maximum of unsigned integral types having a minimum size. */
688 # define UINT_LEAST8_MAX UINT8_MAX
689 # define UINT_LEAST16_MAX UINT16_MAX
690 # define UINT_LEAST32_MAX UINT32_MAX
691 # define UINT_LEAST64_MAX UINT64_MAX
700 if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
701 AC_MSG_NOTICE([$ac_stdint_h is unchanged])
703 ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
704 AS_MKDIR_P(["$ac_dir"])
706 mv $ac_stdint $ac_stdint_h
708 ],[# variables for create stdint.h replacement
711 ac_stdint_h="$ac_stdint_h"
712 _ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
713 ac_cv_stdint_message="$ac_cv_stdint_message"
714 ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
715 ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
716 ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
717 ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
718 ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
719 ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
720 ac_cv_char_data_model="$ac_cv_char_data_model"
721 ac_cv_long_data_model="$ac_cv_long_data_model"
722 ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
723 ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
724 ac_cv_type_intmax_t="$ac_cv_type_intmax_t"