We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2121 - GCC throws error on SDL_FORCE_INLINE when compiling with -ansi
Summary: GCC throws error on SDL_FORCE_INLINE when compiling with -ansi
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-29 20:08 UTC by Jānis Rūcis
Modified: 2013-10-01 05:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jānis Rūcis 2013-09-29 20:08:46 UTC
As per summary, the SDL_FORCE_INLINE macro definition causes a hard error when compiling against the ANSI C standard (GCC -ansi flag).

Here's my test case:


#include <SDL.h>

int main(int argc, char *argv[])
{
    return 0;
}


gcc -ansi sdl2-test.c $(sdl2-config --cflags --libs)
In file included from /usr/include/SDL2/SDL_main.h:25:0,
                 from /usr/include/SDL2/SDL.h:65,
                 from sdl2-test.c:1:
/usr/include/SDL2/SDL_stdinc.h:258:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
 SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t dwords)
                  ^
Comment 1 Sam Lantinga 2013-10-01 05:36:03 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/4434498bf4b9