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

Fix Windows warnings about APIENTRY from GLAD library #2339

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

totalgee
Copy link
Contributor

@totalgee totalgee commented Jan 21, 2025

This is an alternative to my PR #2332, which didn't actually solve the problem with these GLAD warnings with MSVC, and not as "heavy" as updating to GLAD 2:

1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition
1>(compiling source file '../../src/cinder/gl/wrapper.cpp')
1>C:\Users\holag\Documents\Work\...\cinder\include\glad\glad.h(518,1):
1>see previous definition of 'APIENTRY'

This happens when building with MSVC, depending on the include order of GLAD headers vs Windows headers that define APIENTRY. Adding the push/pop seems like a simple solution to the problem.

@totalgee
Copy link
Contributor Author

Hmm, unfortunately this doesn't work on other platforms (see compile error e.g. on Ubuntu above). The macro (referenced by other macros) is undefined when it is needed later (compiling glad.c)...or something like that.

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.

1 participant