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