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

Summary: GCC throws error on SDL_FORCE_INLINE when compiling with -ansi
Product: SDL Reporter: Jānis Rūcis <parasti+libsdl>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.0   
Hardware: x86_64   
OS: Linux   

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