| 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 | ||
Fixed, thanks! http://hg.libsdl.org/SDL/rev/4434498bf4b9 |
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) ^