[cairo] Re: Cairographics on win32

Jason Dorje Short jdorje at users.sf.net
Wed Mar 30 16:28:05 PST 2005


Jason Dorje Short wrote:
> 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.)

This patch implements the changes entirely.  So long as stdint.h, 
inttypes.h, and sys/int_types.h are where the types are declared it 
should work on all platforms.

The 64-bit and 128-bit types are implemented in cairo-wideint.h already. 
  These have their own bugs 
(https://bugzilla.mozilla.org/show_bug.cgi?id=287035) but
  should provide some fallbacks.  However they're surely much slower so 
if possible a native type should be used.  I'm not really sure how best 
to do this so I just added a simple check for 64-bit long longs.

Note adding these types without #ifdef protection won't work too well; 
it'll conflict with the types already included by the system (for this 
same reason I can't actually test the new typedefs).  However it would 
work if the types were renamed as cairo_uint8_t and the like.

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


More information about the cairo mailing list