From d4209c331f0823c585643e6a7197107321ba2049 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 7 Apr 2005 12:05:52 +0000 Subject: [PATCH] Use configure-time checks for stdint.h vs. inttypes.h vs. sys/int_types.h rather than ad-hoc system-specific macros. Also define these types manually none of these header are available. (Thanks to Jason Dorje Short ). --- ChangeLog | 10 ++++++++++ configure.in | 1 + src/cairo-wideint.h | 23 +++++++++++++++++------ src/cairoint.h | 10 ---------- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 725f7ce44..ae2b0f1bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-04-07 Carl Worth + + * configure.in: + * src/cairo-wideint.h: + * src/cairoint.h: Use configure-time checks for stdint.h + vs. inttypes.h vs. sys/int_types.h rather than ad-hoc + system-specific macros. Also define these types manually none of + these header are available. (Thanks to Jason Dorje Short + ). + 2005-04-07 Carl Worth * test/imagediff.c (main): Fix to return non-zero status on error. diff --git a/configure.in b/configure.in index d9dd56864..154f0813c 100644 --- a/configure.in +++ b/configure.in @@ -398,6 +398,7 @@ AC_SUBST(ATSUI_FONT_FEATURE) dnl =========================================================================== dnl Checks for precise integer types +AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h]) AC_CHECK_TYPES([uint64_t, uint128_t]) dnl Use lots of warning flags with GCC diff --git a/src/cairo-wideint.h b/src/cairo-wideint.h index de52fb349..7db22a8bd 100644 --- a/src/cairo-wideint.h +++ b/src/cairo-wideint.h @@ -1,5 +1,5 @@ /* - * $Id: cairo-wideint.h,v 1.7 2005-03-29 19:48:58 tor Exp $ + * $Id: cairo-wideint.h,v 1.8 2005-04-07 19:05:52 cworth Exp $ * * Copyright © 2004 Keith Packard * @@ -38,13 +38,24 @@ #ifndef CAIRO_WIDEINT_H #define CAIRO_WIDEINT_H -#if defined (__SVR4) && defined (__sun) +#if HAVE_STDINT_H +# include +#elif HAVE_INTTYPES_H +# include +#elif HAVE_SYS_INT_TYPES_H # include #else -# if defined (__OpenBSD__) || defined (_AIX) -# include -# else -# include +typedef signed char int8_t; +typedef short int16_t; +typedef long int32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; + +# if sizeof(long long) == 64 +typedef long long int64_t; +typedef unsigned long long uint64_t; +# define HAVE_UINT64_T # endif #endif diff --git a/src/cairoint.h b/src/cairoint.h index d1ebb1bfc..029841676 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -56,16 +56,6 @@ #include #include -#if defined (__SVR4) && defined (__sun) -# include -#else -# if defined (__OpenBSD__) || defined (_AIX) -# include -# else -# include -# endif -#endif - #include "cairo.h" #if __GNUC__ >= 3 && defined(__ELF__)