Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken preprocessor logic for SDL_LEAN_AND_MEAN (and possibly more?) #11344

Open
AntTheAlchemist opened this issue Oct 27, 2024 · 1 comment · May be fixed by #11400
Open

Broken preprocessor logic for SDL_LEAN_AND_MEAN (and possibly more?) #11344

AntTheAlchemist opened this issue Oct 27, 2024 · 1 comment · May be fixed by #11400

Comments

@AntTheAlchemist
Copy link
Contributor

AntTheAlchemist commented Oct 27, 2024

Currently, SDL_LEAN_AND_MEAN doesn't do anything, due to this #ifdef logic (for example):

#ifndef SDL_LEAN_AND_MEAN
#define SDL_LEAN_AND_MEAN 0
#endif
// ...
#ifndef SDL_VIDEO_RENDER_SW
#define SDL_VIDEO_RENDER_SW !SDL_LEAN_AND_MEAN
#endif

SDL_VIDEO_RENDER_SW will always be defined (as either 0 or 1, or blank), so therefore:

#ifdef SDL_VIDEO_RENDER_SW
    &SW_RenderDriver,
#endif

This will always add the software renderer, no matter if SDL_LEAN_AND_MEAN is defined as 0, 1 or undefined. We should be using #undef SDL_VIDEO_RENDER_SW?

Commit 387774a seemed to break this, and it may affect much more than SDL_LEAN_AND_MEAN?

@AntTheAlchemist
Copy link
Contributor Author

AntTheAlchemist commented Oct 27, 2024

#undef won't work, because there are still places that use #if and expecting a 0 / 1.

@Lzard Lzard linked a pull request Nov 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant