[cairo] Re: Cairographics on win32

Jason Dorje Short jdorje at users.sf.net
Wed Mar 30 15:25:22 PST 2005


Carl Worth wrote:

>>>Also, the included copy of stdint.h has either incompatible or at
>>>least insufficient licensing information attached. But I can supply a
>>>version with cairo-compatible licensing, I think.
>>
>>stdint.h - is a C99 thing, and VC++ doesn't have it. So, a copy with
>>GNU/BSD license that I can hack to suit VC++ types would be nice.
> 
> 
> Actually, I think the right thing to do in this case might be to just
> add a block something like the following:
> 
> typedef signed char int8_t;
> typedef short int16_t;
> typedef long int32_t;
> typedef long long int64_t;
> typedef unsigned char uint8_t;
> typedef unsigned short uint16_t;
> typedef unsigned long uint32_t;
> typedef unsigned long long uint64_t;
> 
> along with the appropriate win32/i386/msvc-specific protection,
> directly into the block in cairoint.h where we already have other
> OS-specific protection to include inttypes.h or stdint.h.
> 
> I don't think we use much from stdint.h beyond the types listed above,
> if anything.

The better way to handle this is with configure-time checks for 
features, not build-time checks for platforms.  (At least this is what 
the autoconf manual will tell you.)

Something like the attached patch is a beginning on this (although it is 
incomplete).


This patch conflicts with the typedefing in cairo_wideint.h:

typedef struct _cairo_uint64 {
     uint32_t	lo, hi;
} cairo_uint64_t, cairo_int64_t;

I don't know if "long long int" is portable or if a hack like this (with 
lots of typecast functions for manual, slow, conversions between integer 
types) is needed.


Also, rather than checking for headers it's also possible to check for 
types specifically (via AC_CHECK_TYPES).  This may be more trouble than 
it's worth because you have to check for all of them.  This is what's 
already being done for 64-bit integer types.

-jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stdint.diff
Type: text/x-patch
Size: 1503 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050330/61264912/stdint.bin


More information about the cairo mailing list