Skip to content

Commit

Permalink
Fix GLAD compilation issue on Mac/Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
totalgee committed Jan 23, 2025
1 parent bf94253 commit 59c8f7e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/glad/glad.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,14 @@
#ifndef __glad_h_
#define __glad_h_

#pragma push_macro("APIENTRY")


#ifdef __gl_h_
#error OpenGL header already included, remove this include, glad already provides it
#endif
#define __gl_h_

#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
#pragma push_macro("APIENTRY")
#define GLAD_PUSHED_APIENTRY
#define APIENTRY __stdcall
#endif

Expand Down Expand Up @@ -14161,6 +14160,9 @@ GLAPI int GLAD_GL_S3_s3tc;
}
#endif

#ifdef GLAD_PUSHED_APIENTRY
#undef GLAD_PUSHED_APIENTRY
#pragma pop_macro("APIENTRY")
#endif // GLAD_PUSHED_APIENTRY

#endif

0 comments on commit 59c8f7e

Please sign in to comment.