Re: Troublesome C99 ?

Antonio Ospite <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Tue, 05 Dec 2017 10:51:50 +0000
John Emmas <[email protected]> wrote:

> Hi there,
> 
> This morning I noticed this change in git master (which produces a 
> syntax error now when compiling with MSVC):-
> 
[...]
> // In 'src/cairo-svg-surface.c' :-
>      static const char * _cairo_svg_unit_strings[] =
>      {
>          [CAIRO_SVG_UNIT_USER] = "",  // <--- error occurs here !!
[...]
> 
> I think it's ( possibly? ) C99, which MSVC never fully supported :-(
> 

This was me, I assumed using C99 initializers was OK.
If it's not then the attached patch fixes this.

Should I send it over to bugzilla?

BTW when compilation fails it is generally a good idea to report the
exact message from the compiler.

Ciao,
   Antonio

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
0001-svg-fix-compilation-with-MSVC-which-doesn-t-support-.patch (text/x-diff, 1.3 KB)
From 815685bc0a7432788d55dbe45e18c99f44a26f6f Mon Sep 17 00:00:00 2001
From: Antonio Ospite <[email protected]>
Date: Fri, 8 Dec 2017 09:44:27 +0100
Subject: [PATCH] svg: fix compilation with MSVC which doesn't support C99
 initializers
X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM<pyWR#k60!#=#>/Vb;]yA5<GWI5`6u&+
 ;6b'@y|8w"wB;4/e!7wYYrcqdJFY,~%Gk_4]cq$Ei/7<j&N3ah(m`ku?pX.&+~:_/wC~dwn^)MizBG
 !pE^+iDQQ1yC6^,)YDKkxDd!T>\I~93>J<_`<4)A{':UrE

---
 src/cairo-svg-surface.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 1b568542e..c2ef83efa 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -124,16 +124,16 @@ static const char * _cairo_svg_internal_version_strings[CAIRO_SVG_VERSION_LAST]
 
 static const char * _cairo_svg_unit_strings[] =
 {
-    [CAIRO_SVG_UNIT_USER] = "",
-    [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] = "%"
+    "",
+    "em",
+    "ex",
+    "px",
+    "in",
+    "cm",
+    "mm",
+    "pt",
+    "pc",
+    "%"
 };
 
 struct cairo_svg_page {
-- 
2.15.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.