comparison config/stdint.m4 @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
comparison
equal deleted inserted replaced
56:3c8a44c06a95 63:b7f97abdc517
232 232
233 #ifndef _UINT8_T 233 #ifndef _UINT8_T
234 #define _UINT8_T 234 #define _UINT8_T
235 #ifndef __uint8_t_defined 235 #ifndef __uint8_t_defined
236 #define __uint8_t_defined 236 #define __uint8_t_defined
237 #ifndef uint8_t
237 typedef unsigned $acx_cv_type_int8_t uint8_t; 238 typedef unsigned $acx_cv_type_int8_t uint8_t;
239 #endif
238 #endif 240 #endif
239 #endif 241 #endif
240 242
241 #ifndef _UINT16_T 243 #ifndef _UINT16_T
242 #define _UINT16_T 244 #define _UINT16_T
243 #ifndef __uint16_t_defined 245 #ifndef __uint16_t_defined
244 #define __uint16_t_defined 246 #define __uint16_t_defined
247 #ifndef uint16_t
245 typedef unsigned $acx_cv_type_int16_t uint16_t; 248 typedef unsigned $acx_cv_type_int16_t uint16_t;
249 #endif
246 #endif 250 #endif
247 #endif 251 #endif
248 252
249 #ifndef _UINT32_T 253 #ifndef _UINT32_T
250 #define _UINT32_T 254 #define _UINT32_T
251 #ifndef __uint32_t_defined 255 #ifndef __uint32_t_defined
252 #define __uint32_t_defined 256 #define __uint32_t_defined
257 #ifndef uint32_t
253 typedef unsigned $acx_cv_type_int32_t uint32_t; 258 typedef unsigned $acx_cv_type_int32_t uint32_t;
259 #endif
254 #endif 260 #endif
255 #endif 261 #endif
256 262
257 #ifndef _INT8_T 263 #ifndef _INT8_T
258 #define _INT8_T 264 #define _INT8_T
259 #ifndef __int8_t_defined 265 #ifndef __int8_t_defined
260 #define __int8_t_defined 266 #define __int8_t_defined
267 #ifndef int8_t
261 typedef $acx_cv_type_int8_t int8_t; 268 typedef $acx_cv_type_int8_t int8_t;
269 #endif
262 #endif 270 #endif
263 #endif 271 #endif
264 272
265 #ifndef _INT16_T 273 #ifndef _INT16_T
266 #define _INT16_T 274 #define _INT16_T
267 #ifndef __int16_t_defined 275 #ifndef __int16_t_defined
268 #define __int16_t_defined 276 #define __int16_t_defined
277 #ifndef int16_t
269 typedef $acx_cv_type_int16_t int16_t; 278 typedef $acx_cv_type_int16_t int16_t;
279 #endif
270 #endif 280 #endif
271 #endif 281 #endif
272 282
273 #ifndef _INT32_T 283 #ifndef _INT32_T
274 #define _INT32_T 284 #define _INT32_T
275 #ifndef __int32_t_defined 285 #ifndef __int32_t_defined
276 #define __int32_t_defined 286 #define __int32_t_defined
287 #ifndef int32_t
277 typedef $acx_cv_type_int32_t int32_t; 288 typedef $acx_cv_type_int32_t int32_t;
289 #endif
278 #endif 290 #endif
279 #endif 291 #endif
280 EOF 292 EOF
281 elif test "$ac_cv_type_u_int32_t" = yes; then 293 elif test "$ac_cv_type_u_int32_t" = yes; then
282 sed 's/^ *//' >> tmp-stdint.h <<EOF 294 sed 's/^ *//' >> tmp-stdint.h <<EOF
294 306
295 #ifndef _UINT8_T 307 #ifndef _UINT8_T
296 #define _UINT8_T 308 #define _UINT8_T
297 #ifndef __uint8_t_defined 309 #ifndef __uint8_t_defined
298 #define __uint8_t_defined 310 #define __uint8_t_defined
311 #ifndef uint8_t
299 typedef u_int8_t uint8_t; 312 typedef u_int8_t uint8_t;
313 #endif
300 #endif 314 #endif
301 #endif 315 #endif
302 316
303 #ifndef _UINT16_T 317 #ifndef _UINT16_T
304 #define _UINT16_T 318 #define _UINT16_T
305 #ifndef __uint16_t_defined 319 #ifndef __uint16_t_defined
306 #define __uint16_t_defined 320 #define __uint16_t_defined
321 #ifndef uint16_t
307 typedef u_int16_t uint16_t; 322 typedef u_int16_t uint16_t;
323 #endif
308 #endif 324 #endif
309 #endif 325 #endif
310 326
311 #ifndef _UINT32_T 327 #ifndef _UINT32_T
312 #define _UINT32_T 328 #define _UINT32_T
313 #ifndef __uint32_t_defined 329 #ifndef __uint32_t_defined
314 #define __uint32_t_defined 330 #define __uint32_t_defined
331 #ifndef uint32_t
315 typedef u_int32_t uint32_t; 332 typedef u_int32_t uint32_t;
333 #endif
316 #endif 334 #endif
317 #endif 335 #endif
318 EOF 336 EOF
319 else 337 else
320 sed 's/^ *//' >> tmp-stdint.h <<EOF 338 sed 's/^ *//' >> tmp-stdint.h <<EOF
362 #endif 380 #endif
363 #ifndef _UINT64_T 381 #ifndef _UINT64_T
364 #define _UINT64_T 382 #define _UINT64_T
365 #ifndef __uint64_t_defined 383 #ifndef __uint64_t_defined
366 #define __uint64_t_defined 384 #define __uint64_t_defined
385 #ifndef uint64_t
367 typedef u_int64_t uint64_t; 386 typedef u_int64_t uint64_t;
387 #endif
368 #endif 388 #endif
369 #endif 389 #endif
370 EOF 390 EOF
371 elif test -n "$acx_cv_type_int64_t"; then 391 elif test -n "$acx_cv_type_int64_t"; then
372 sed 's/^ *//' >> tmp-stdint.h <<EOF 392 sed 's/^ *//' >> tmp-stdint.h <<EOF
373 393
374 /* architecture has a 64-bit type, $acx_cv_type_int64_t */ 394 /* architecture has a 64-bit type, $acx_cv_type_int64_t */
375 #ifndef _INT64_T 395 #ifndef _INT64_T
376 #define _INT64_T 396 #define _INT64_T
397 #ifndef int64_t
377 typedef $acx_cv_type_int64_t int64_t; 398 typedef $acx_cv_type_int64_t int64_t;
399 #endif
378 #endif 400 #endif
379 #ifndef _UINT64_T 401 #ifndef _UINT64_T
380 #define _UINT64_T 402 #define _UINT64_T
381 #ifndef __uint64_t_defined 403 #ifndef __uint64_t_defined
382 #define __uint64_t_defined 404 #define __uint64_t_defined
405 #ifndef uint64_t
383 typedef unsigned $acx_cv_type_int64_t uint64_t; 406 typedef unsigned $acx_cv_type_int64_t uint64_t;
407 #endif
384 #endif 408 #endif
385 #endif 409 #endif
386 EOF 410 EOF
387 else 411 else
388 sed 's/^ *//' >> tmp-stdint.h <<EOF 412 sed 's/^ *//' >> tmp-stdint.h <<EOF
390 /* some common heuristics for int64_t, using compiler-specific tests */ 414 /* some common heuristics for int64_t, using compiler-specific tests */
391 #if defined __STDC_VERSION__ && (__STDC_VERSION__-0) >= 199901L 415 #if defined __STDC_VERSION__ && (__STDC_VERSION__-0) >= 199901L
392 #ifndef _INT64_T 416 #ifndef _INT64_T
393 #define _INT64_T 417 #define _INT64_T
394 #ifndef __int64_t_defined 418 #ifndef __int64_t_defined
419 #ifndef int64_t
395 typedef long long int64_t; 420 typedef long long int64_t;
421 #endif
396 #endif 422 #endif
397 #endif 423 #endif
398 #ifndef _UINT64_T 424 #ifndef _UINT64_T
399 #define _UINT64_T 425 #define _UINT64_T
426 #ifndef uint64_t
400 typedef unsigned long long uint64_t; 427 typedef unsigned long long uint64_t;
428 #endif
401 #endif 429 #endif
402 430
403 #elif defined __GNUC__ && defined (__STDC__) && __STDC__-0 431 #elif defined __GNUC__ && defined (__STDC__) && __STDC__-0
404 /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and 432 /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
405 does not implement __extension__. But that compiler doesn't define 433 does not implement __extension__. But that compiler doesn't define
408 # define __extension__ 436 # define __extension__
409 # endif 437 # endif
410 438
411 # ifndef _INT64_T 439 # ifndef _INT64_T
412 # define _INT64_T 440 # define _INT64_T
441 # ifndef int64_t
413 __extension__ typedef long long int64_t; 442 __extension__ typedef long long int64_t;
443 # endif
414 # endif 444 # endif
415 # ifndef _UINT64_T 445 # ifndef _UINT64_T
416 # define _UINT64_T 446 # define _UINT64_T
447 # ifndef uint64_t
417 __extension__ typedef unsigned long long uint64_t; 448 __extension__ typedef unsigned long long uint64_t;
418 # endif 449 # endif
450 # endif
419 451
420 #elif !defined __STRICT_ANSI__ 452 #elif !defined __STRICT_ANSI__
421 # if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ 453 # if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
422 454
423 # ifndef _INT64_T 455 # ifndef _INT64_T
424 # define _INT64_T 456 # define _INT64_T
457 # ifndef int64_t
425 typedef __int64 int64_t; 458 typedef __int64 int64_t;
459 # endif
426 # endif 460 # endif
427 # ifndef _UINT64_T 461 # ifndef _UINT64_T
428 # define _UINT64_T 462 # define _UINT64_T
463 # ifndef uint64_t
429 typedef unsigned __int64 uint64_t; 464 typedef unsigned __int64 uint64_t;
430 # endif 465 # endif
466 # endif
431 # endif /* compiler */ 467 # endif /* compiler */
432 468
433 #endif /* ANSI version */ 469 #endif /* ANSI version */
434 EOF 470 EOF
435 fi 471 fi
438 if test "$ac_cv_type_uintptr_t" != yes; then 474 if test "$ac_cv_type_uintptr_t" != yes; then
439 sed 's/^ *//' >> tmp-stdint.h <<EOF 475 sed 's/^ *//' >> tmp-stdint.h <<EOF
440 476
441 /* Define intptr_t based on sizeof(void*) = $ac_cv_sizeof_void_p */ 477 /* Define intptr_t based on sizeof(void*) = $ac_cv_sizeof_void_p */
442 #ifndef __uintptr_t_defined 478 #ifndef __uintptr_t_defined
479 #ifndef uintptr_t
443 typedef u$acx_cv_type_intptr_t uintptr_t; 480 typedef u$acx_cv_type_intptr_t uintptr_t;
444 #endif 481 #endif
482 #endif
445 #ifndef __intptr_t_defined 483 #ifndef __intptr_t_defined
484 #ifndef intptr_t
446 typedef $acx_cv_type_intptr_t intptr_t; 485 typedef $acx_cv_type_intptr_t intptr_t;
486 #endif
447 #endif 487 #endif
448 EOF 488 EOF
449 fi 489 fi
450 490
451 # ------------- done intptr types, emit int_least types ------------ 491 # ------------- done intptr types, emit int_least types ------------
494 534
495 if test "$ac_cv_type_uintmax_t" != yes; then 535 if test "$ac_cv_type_uintmax_t" != yes; then
496 sed 's/^ *//' >> tmp-stdint.h <<EOF 536 sed 's/^ *//' >> tmp-stdint.h <<EOF
497 537
498 /* Define intmax based on what we found */ 538 /* Define intmax based on what we found */
539 #ifndef intmax_t
499 #ifdef _INT64_T 540 #ifdef _INT64_T
500 typedef int64_t intmax_t; 541 typedef int64_t intmax_t;
501 #else 542 #else
502 typedef long intmax_t; 543 typedef long intmax_t;
503 #endif 544 #endif
545 #endif
546 #ifndef uintmax_t
504 #ifdef _UINT64_T 547 #ifdef _UINT64_T
505 typedef uint64_t uintmax_t; 548 typedef uint64_t uintmax_t;
506 #else 549 #else
507 typedef unsigned long uintmax_t; 550 typedef unsigned long uintmax_t;
551 #endif
508 #endif 552 #endif
509 EOF 553 EOF
510 fi 554 fi
511 555
512 sed 's/^ *//' >> tmp-stdint.h <<EOF 556 sed 's/^ *//' >> tmp-stdint.h <<EOF