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

IDE DEBUG symbol #139

Merged
merged 2 commits into from
Jun 2, 2021
Merged

IDE DEBUG symbol #139

merged 2 commits into from
Jun 2, 2021

Conversation

dspverden
Copy link
Contributor

This little change allows crow to be used together with IDEs (like Xcode) that create their own DEBUG symbol during compilation. Else including crow_all.h will make compiling fail because it defines a DEBUG in an enum.

Copy link
Member

@The-EDev The-EDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work, but there is already a fix for something similar where the all caps enum is disabled if ERROR is defined, might be best to just add another #ifndef DEBUG there.

I'm referencing the following: https://github.com/CrowCpp/crow/blob/44748e63ea6c12a134191369f10f79402a4be7de/include/crow/logging.h#L16-L22

@dspverden
Copy link
Contributor Author

Actually I think the DEBUG symbol is never used in your code

@The-EDev
Copy link
Member

The-EDev commented Jun 2, 2021

It is meant to be used when defining the logging level by the developer, the examples don't use it because MSVC lacks the all caps definitions.

@dspverden
Copy link
Contributor Author

Changed it as you suggested.

@The-EDev
Copy link
Member

The-EDev commented Jun 2, 2021

Just to be 100% certain, it does fix your problem on Xcode, right? (I don't have a mac so I can't test it)

@dspverden
Copy link
Contributor Author

dspverden commented Jun 2, 2021

Yes. This issue prevented me from compiling with Xcode. Now it does compile in Xcode. The reason was that Xcode creates a DEBUG symbol. I could stop Xcode doing this, but then I cannot use DEBUG in the rest of my code.

@The-EDev The-EDev self-requested a review June 2, 2021 15:29
@The-EDev The-EDev merged commit 4579d7b into CrowCpp:master Jun 2, 2021
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