Skip to content

Commit

Permalink
Add fallback definition for EGL_CAST
Browse files Browse the repository at this point in the history
The EGL API update from d11104f introduced a dependency on the
EGL_CAST() macro, provided by an updated eglplatform.h. Given that we
don't provide eglplatform.h, add a fallback definition for if we're
building against Mesa 17.0.x or similar.

https://bugs.gentoo.org/show_bug.cgi?id=623926
  • Loading branch information
fooishbar committed Jul 7, 2017
1 parent b157a4d commit ebe3a53
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gen_dispatch.py
Expand Up @@ -491,6 +491,15 @@ def write_header(self, out_file):
self.outln('#include "epoxy/gl.h"')
if self.target == "egl":
self.outln('#include "EGL/eglplatform.h"')
# Account for older eglplatform.h, which doesn't define
# the EGL_CAST macro.
self.outln('#ifndef EGL_CAST')
self.outln('#if defined(__cplusplus)')
self.outln('#define EGL_CAST(type, value) (static_cast<type>(value))')
self.outln('#else')
self.outln('#define EGL_CAST(type, value) ((type) (value))')
self.outln('#endif')
self.outln('#endif')
else:
# Add some ridiculous inttypes.h redefinitions that are
# from khrplatform.h and not included in the XML. We
Expand Down

0 comments on commit ebe3a53

Please sign in to comment.