[cairo] Troublesome C99 ?

John Emmas john at creativepost.co.uk
Tue Dec 5 10:51:50 UTC 2017


Hi there,

This morning I noticed this change in git master (which produces a 
syntax error now when compiling with MSVC):-

// In 'scr/cairo-svg.h' :-
     typedef enum _cairo_svg_unit {
         CAIRO_SVG_UNIT_USER = 0,
         CAIRO_SVG_UNIT_EM,
         CAIRO_SVG_UNIT_EX,
         CAIRO_SVG_UNIT_PX,
         CAIRO_SVG_UNIT_IN,
         CAIRO_SVG_UNIT_CM,
         CAIRO_SVG_UNIT_MM,
         CAIRO_SVG_UNIT_PT,
         CAIRO_SVG_UNIT_PC,
         CAIRO_SVG_UNIT_PERCENT
     } cairo_svg_unit_t;


// In 'src/cairo-svg-surface.c' :-
     static const char * _cairo_svg_unit_strings[] =
     {
         [CAIRO_SVG_UNIT_USER] = "",  // <--- error occurs here !!
         [CAIRO_SVG_UNIT_EM] = "em",
         [CAIRO_SVG_UNIT_EX] = "ex",
         [CAIRO_SVG_UNIT_PX] = "px",
         [CAIRO_SVG_UNIT_IN] = "in",
         [CAIRO_SVG_UNIT_CM] = "cm",
         [CAIRO_SVG_UNIT_MM] = "mm",
         [CAIRO_SVG_UNIT_PT] = "pt",
         [CAIRO_SVG_UNIT_PC] = "pc",
         [CAIRO_SVG_UNIT_PERCENT] = "%"
     }

I think it's ( possibly? ) C99, which MSVC never fully supported :-(

John


More information about the cairo mailing list