[cairo-bugs] [Bug 84908] New: Compilation errors with MSVC after recent changes to 'cairo-path-stroke-traps.c'

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Oct 11 03:40:44 PDT 2014


            Bug ID: 84908
           Summary: Compilation errors with MSVC after recent changes to
           Product: cairo
           Version: unspecified
          Hardware: Other
                OS: Windows (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: chris at chris-wilson.co.uk
          Reporter: johne53 at tiscali.co.uk
        QA Contact: cairo-bugs at cairographics.org

Firstly, apologies. I'm not sure whether this needs to get filed under
'general' or under 'win32-backend' but anyway, here it is...

Since updating from git master about a week ago (ver 1.13.1) I can no longer
compile 'cairo-path-stroke-traps.c' with Microsoft VC8. I get errors at lines
302, 303, 464 and 465. As an example, line 302 looks like this:-

cairo_point_t t[] = { in->point, *inpt, *outpt }

Given that 'in->point', '*inpt' and '*outpt' are all structs, I suspect the
problem is that the compiler would need to generate a default copy c'tor for
'cairo_point_t'. MSVC does this when compiling as C++ but not when compiling as
'C'. Unfortunately, if I change my project to build as C++ I just get a whole
slew of other errors elsewhere. So currently, I can't compile as 'C', nor as

The errors at lines 302 and 303 can be fixed as follows. I'm not claiming that
my fix is the most elegant one (and of course, somebody will need to verify
that it fulfils the original intention) but it does at least compile!! If
somebody wants to come up with a more elegant solution, this should at least
tell them what's going wrong:-

1) Remove lines 302 and 303 and replace with the following code:-

cairo_point_t t[3];
cairo_point_t e[4];

memcpy( &t[0], &in->point, sizeof(cairo_point_t) );
memcpy( &t[1], inpt, sizeof(cairo_point_t) );
memcpy( &t[2], outpt, sizeof(cairo_point_t) );

memcpy( &e[0], &in->cw, sizeof(cairo_point_t) );
memcpy( &e[1], &in->ccw, sizeof(cairo_point_t) );
memcpy( &e[2], &out->cw, sizeof(cairo_point_t) );
memcpy( &e[3], &out->ccw, sizeof(cairo_point_t) );

2) It looks like the same fix would probably work for lines 464 and 465.

Hope that helps,


You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20141011/0022d5aa/attachment.html>

More information about the cairo-bugs mailing list