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 - Fix build for disabled SDL render subsystem
Summary: Fix build for disabled SDL render subsystem
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-26 08:57 UTC by Marcus von Appen
Modified: 2013-04-25 03:15 UTC (History)
1 user (show)

See Also:


Attachments
SDL_render.c patch for a disabled SDL render subsystem (530 bytes, patch)
2012-08-26 08:57 UTC, Marcus von Appen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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