[SDL] Fail to build SDL-2.0.5, after enabling -std=c99 ...

JIA Pei jp4work at gmail.com
Mon Mar 6 17:01:58 PST 2017


Hi, Ryan:


My current solution is to* change -std=c99 to -std=gnu99.*

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: ‘M_PI’
undeclared (first use in this function)
        radangle = 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 ‘action’
isn’t 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 ‘action’
isn’t known
    struct sigaction action;


Cheers


On Mon, Mar 6, 2017 at 2:00 PM, Ryan C. Gordon <icculus at icculus.org> wrote:

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



-- 

Pei JIA, Ph.D.

Email: jp4work at gmail.com
cell in Canada:    +1 778-863-5816
cell in China: +86 186-8244-3503

Welcome to Vision Open
http://www.visionopen.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20170306/120c0811/attachment.htm>


More information about the SDL mailing list