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 1583

Summary: Fix build for disabled SDL render subsystem
Product: SDL Reporter: Marcus von Appen <mva>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: gabomdq
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: SDL_render.c patch for a disabled SDL render subsystem

Description Marcus von Appen 2012-08-26 08:57:36 UTC
Created attachment 939 [details]
SDL_render.c patch for a disabled SDL render subsystem

If one wants to disable the SDL render subsystem, the build breaks on several platforms due to an empty render_drivers array in SDL_render.c.

The attached patch fixes the build by using a NULL pointer. This however might lead to issues with the ARRAY_SIZE macros for the SDL_Render* functions (although they should not be able to be used on such a build).
Comment 1 Marcus von Appen 2013-04-24 05:32:18 UTC
Are there any news for this issue?
Comment 2 Gabriel Jacobo 2013-04-24 12:51:15 UTC
I can't reproduce this using configure+make on Linux.

configure --disable-render
make

Compiles perfectly.

Compiling testsprite2 against this library yields: "Couldn't create renderer: Couldn't find matching render driver" as expected.

Can you let me know what platforms are giving you problems so I can verify?
Comment 3 Marcus von Appen 2013-04-24 13:29:02 UTC
Try any system that uses a pure ISO C90 compiler. SDL_RENDER_DISABLED constructs a zero length array for render_drivers, which works well on most compilers, but not for e.g. Visual C++.
Comment 4 Sam Lantinga 2013-04-25 03:15:47 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/003d40e446f5