[cairo] Re[2]: Cairographics on win32

Oleg Smolsky oleg.smolsky at pacific-simulators.co.nz
Wed Mar 30 19:44:28 PST 2005

Hello Carl,

> 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 ....[snip]
Ok, there are three issues here:
- actual type definitions. They should be as follows for VC++:
        typedef signed char     int8_t;
        typedef short int       int16_t;
        typedef int             int32_t;
        typedef __int64         int64_t;

        typedef unsigned char           uint8_t;
        typedef unsigned short int      uint16_t;
        typedef unsigned int            uint32_t;
        typedef unsigned __int64        uint64_t;

- VC++ detection. You can use #ifdef _MSC_VER - the format of .vcproj
  ensures that the appropriate version of VC++ is used.

- explicit #include <stdint.h> that is present in a few places. This
  must not be done when compiling using VC++ than.

> Thanks. Try cairo/packaging/msvc if that sounds good to you.
That sounds fine.

Here is a patch against CVS/HEAD that fixes all of these things to my
linking :) Please have a look.

P.S. on the portability note: cairo-png.c line 233 and 234:
     static const int PNG_SIG_SIZE = 8;
     unsigned char png_sig[PNG_SIG_SIZE];
     - this is not valid ANSI C. Unfortunately, the ancient standard
     doesn't allow using const int in arrays or case statements, so,
     this line generates a VC++ error.
P.P.S. where did PNG surface go?

Best regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch2
Type: application/octet-stream
Size: 15824 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050331/7f63299e/patch2.obj

More information about the cairo mailing list