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

Guard against DEBUG Redefinition #4835

Merged
merged 1 commit into from
Mar 12, 2025
Merged

Conversation

NiamhNightglow
Copy link
Contributor

I added an #undef DEBUG before the DEBUG(...) macro definition in jar_xm.h to prevent redefinition warnings and potential conflicts. This macro is commonly defined by external build systems for debug configurations, so undefining it here avoids collisions without disrupting other code.

I also looked and jar_xm.h seems to only be included in raudio.c as an implementation detail, so I don't believe this should affect anything else(and if anything does include jar_xm.h directly, it was almost certainly getting redefined anyway)

This should help clean up some pesky warnings in debug builds so people can turn on -Werror to enforce clean builds, even if they define DEBUG elsewhere or pass -DDEBUG as a compiler option.

Undefine DEBUG to avoid external redefinition
warnings/conflicts.  This is probably a common
definition for many external build systems'
debug configurations.

This ensures raylib will not emit
a warning about the DEBUG definition being
redefined in external build systems.
@NiamhNightglow
Copy link
Contributor Author

Oops, had some extra whitespace in the commit. I fixed it. Don't need extra changes in the git history, hehe.

@raysan5 raysan5 merged commit a0318e6 into raysan5:master Mar 12, 2025
@raysan5
Copy link
Owner

raysan5 commented Mar 12, 2025

@NiamhNightglow thanks for the review

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 this pull request may close these issues.

2 participants