[cairo] patch for VxWorks / Wind River Diab Compiler support

Manfred Kogler manfred.kogler at gmail.com
Tue Feb 18 15:51:07 CET 2014

Hi all,

I am using cairo in a VxWorks project using Wind River Diab Compiler on a
PPC405 (no HW-floating point support). To get it cleanly compiled, I had to
fix a few warnings and errors:

(1) warning: last enum literal of several enumerations is frequently
suffixed with a comma
        typedef enum _cairo_backend_type {
        } cairo_backend_type_t;

            => removed comma after last enum literal

        typedef enum _cairo_backend_type {
        } cairo_backend_type_t;

(2) error: structure initializations using braced lists must only use
non-const initializers

        - if not defined (default), compiled code is like in cairo 1.12.16
        - if defined (explicitly define for Diab compiler), structure
          using braced lists that use non-const initialializers are
replaced by equivalent
          initialization statements

(3) no-floating-point-optimization / consistency: every call of
_cairo_round() is replaced
    with _cairo_lround()

    This is because to support no-floating-point-optimization, in header
file cairoint.h function
    _cairo_lround() is either inlined to _cairo_round() or implemented on
its own, depending

    Actually a proposal at this point: shouldn't _cairo_round() be removed
completely and
    instead only _cairo_lround() be used? (This proposal is not considered
in my patch!)

(4) error: array declarations of len 0 are not allowed -> replaced with
pointer to array-elem
    see file cairo-image-compositor.c:
        uint8_t _buf[0];
        uint8_t *_buf;

The patch I attached is based on cairo 1.12.16 release. I propose to take
it into the next release.

Many thanks and best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20140218/99e5b7df/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-1.12.16__diab-compiler_support.patch
Type: application/octet-stream
Size: 14031 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20140218/99e5b7df/attachment-0001.obj>

More information about the cairo mailing list