Re: Fail to build SDL-2.0.5, after enabling -std=c99 ...

JIA Pei <[email protected]> Mon, 6 Mar 2017 17:01:58 -0800
Newsgroups gmane.comp.lib.sdl
Message-ID <CADh8Q_VuQUHQ9LksgqjLmbziAAJJpLNNbiWhfcUw-E3RKKkcYw@mail.gmail.com>
--===============6690304774079826416==
Content-Type: multipart/alternative; boundary=001a114708b212f124054a198f0f

--001a114708b212f124054a198f0f
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, Ryan:


My current solution is to* change -std=3Dc99 to -std=3Dgnu99.*

I'm testing your solution, which seems to be correct !!! However, I'm NOW
facing some new issues:

SDL2/SDL2-2.0.5/src/render/software/SDL_rotate.c:136:29: error: =E2=80=98M_=
PI=E2=80=99
undeclared (first use in this function)
        radangle =3D angle * (M_PI / -180.0); /* reverse the angle because
our rotations are clockwise */

SDL2/SDL2-2.0.5/src/events/SDL_quit.c:55:22: error: storage size of =E2=80=
=98action=E2=80=99
isn=E2=80=99t known
    struct sigaction action;


I can easily solve the first problem  *'M_PI' hasn't been declared* by
defining *M_PI *as*:*

*#ifndef M_PI*
*#define M_PI    3.14159265358979323846264338327950288   /* pi */*
*#endif*



However, how to solve the second issue ????
SDL2/SDL2-2.0.5/src/events/SDL_quit.c:55:22: error: storage size of =E2=80=
=98action=E2=80=99
isn=E2=80=99t known
    struct sigaction action;


Cheers


On Mon, Mar 6, 2017 at 2:00 PM, Ryan C. Gordon <[email protected]> wrote:

> On 3/3/17 5:13 PM, Sik the hedgehog wrote:
>
>> Try -std=3Dgnu99 (if I recall correctly)
>>
>> Looks like the problem is using asm instead of a reserved keyword
>> (whoops). -std=3Dc99 will disable any extensions, -std=3Dgnu99 will keep
>> them.
>>
>
> So the actual fix should be to change that to __asm__, right?
>
> --ryan.
>
>
>
>
> _______________________________________________
> SDL mailing list
> [email protected]
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



--=20

Pei JIA, Ph.D.

Email: [email protected]
cell in Canada:    +1 778-863-5816
cell in China: +86 186-8244-3503

Welcome to Vision Open
http://www.visionopen.com

--001a114708b212f124054a198f0f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div>Hi, Ryan:<br></div><div><br></div><div><br></div>=
<div>My current solution is to<b><font size=3D"4"> change -std=3Dc99 to -st=
d=3Dgnu99.</font></b></div><div><br></div><div>I&#39;m testing your solutio=
n, which seems to be correct !!! However, I&#39;m NOW facing some new issue=
s:<br></div><div><br></div><div><span style=3D"font-family:monospace"><span=
 style=3D"font-weight:bold;color:rgb(0,0,0)">SDL2/SDL2-2.0.5/src/render/sof=
tware/SDL_rotate.c:136:29:</span><span style=3D"color:rgb(0,0,0)"> </span><=
span style=3D"font-weight:bold;color:rgb(255,84,84)">error: </span><span st=
yle=3D"color:rgb(0,0,0)">=E2=80=98</span><span style=3D"font-weight:bold;co=
lor:rgb(0,0,0)">M_PI</span><span style=3D"color:rgb(0,0,0)">=E2=80=99 undec=
lared (first use in this function)
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0radangle =3D an=
gle * (M_PI / -180.0); /* reverse the angle because our rotations are clock=
wise */<br>
<br></span></div><div><span style=3D"font-family:monospace"><span style=3D"=
font-weight:bold;color:rgb(0,0,0)">SDL2/SDL2-2.0.5/src/events/SDL_quit.c:55=
:22:</span><span style=3D"color:rgb(0,0,0)"> </span><span style=3D"font-wei=
ght:bold;color:rgb(255,84,84)">error: </span><span style=3D"color:rgb(0,0,0=
)">storage size of =E2=80=98</span><span style=3D"font-weight:bold;color:rg=
b(0,0,0)">action</span><span style=3D"color:rgb(0,0,0)">=E2=80=99 isn=E2=80=
=99t known
</span><br> =C2=A0=C2=A0=C2=A0=C2=A0struct sigaction action;<br>
<br></span></div><div><br></div><div>I can easily solve the first problem =
=C2=A0<b>&#39;M_PI&#39; hasn&#39;t been declared</b> by defining <b>M_PI </=
b>as<b>:</b></div><blockquote style=3D"margin:0px 0px 0px 40px;border:none;=
padding:0px"><div><div><b>#ifndef M_PI</b></div></div><div><div><b>#define =
M_PI =C2=A0 =C2=A03.14159265358979323846264338327950288 =C2=A0 /* pi */</b>=
</div></div><div><div><b>#endif</b></div></div></blockquote><div><br></div>=
<div><br></div><div>However, how to solve the second issue ????</div><div><=
span style=3D"font-family:monospace;font-weight:bold;color:rgb(0,0,0)">SDL2=
/SDL2-2.0.5/src/events/SDL_quit.c:55:22:</span><span style=3D"font-family:m=
onospace;color:rgb(0,0,0)">=C2=A0</span><span style=3D"font-family:monospac=
e;font-weight:bold;color:rgb(255,84,84)">error:=C2=A0</span><span style=3D"=
font-family:monospace;color:rgb(0,0,0)">storage size of =E2=80=98</span><sp=
an style=3D"font-family:monospace;font-weight:bold;color:rgb(0,0,0)">action=
</span><span style=3D"font-family:monospace;color:rgb(0,0,0)">=E2=80=99 isn=
=E2=80=99t known=C2=A0</span><br style=3D"font-family:monospace"><span styl=
e=3D"font-family:monospace">=C2=A0=C2=A0=C2=A0=C2=A0struct sigaction action=
;</span><br></div><div><br></div><div><br></div><div>Cheers</div><div><br><=
/div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Mon=
, Mar 6, 2017 at 2:00 PM, Ryan C. Gordon <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</s=
pan> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex"><span class=3D"">On 3/3/17 5:=
13 PM, Sik the hedgehog wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Try -std=3Dgnu99 (if I recall correctly)<br>
<br>
Looks like the problem is using asm instead of a reserved keyword<br>
(whoops). -std=3Dc99 will disable any extensions, -std=3Dgnu99 will keep<br=
>
them.<br>
</blockquote>
<br></span>
So the actual fix should be to change that to __asm__, right?<span class=3D=
"HOEnZb"><font color=3D"#888888"><br>
<br>
--ryan.</font></span><div class=3D"HOEnZb"><div class=3D"h5"><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
SDL mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected].=
org</a><br>
<a href=3D"http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org" rel=3D"nore=
ferrer" target=3D"_blank">http://lists.libsdl.org/listin<wbr>fo.cgi/sdl-lib=
sdl.org</a><br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
<div class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=
=3D"ltr"><div><br></div><div>Pei JIA, Ph.D.</div><div><br></div><div>Email:=
 <a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</=
a></div><div>cell in Canada: =C2=A0 =C2=A0+1 778-863-5816</div><div>cell in=
 China: +86 186-8244-3503</div><div><br></div>Welcome to Vision Open<br><a =
href=3D"http://www.visionopen.com" target=3D"_blank">http://www.visionopen.=
com</a></div></div>
</div>

--001a114708b212f124054a198f0f--

--===============6690304774079826416==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

--===============6690304774079826416==--