diff options
author | Adam Jackson <ajax@redhat.com> | 2016-09-07 16:50:00 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-09-08 08:26:14 -0400 |
commit | 212501b891faee7d908892a0ea36a287001f7801 (patch) | |
tree | 452d637d82a8c02e2b141200756e133b33db6102 | |
parent | 5e88325551e94e833398c74f8afb5b581e1ce674 (diff) |
egl-nok-swap-region: Fix build against new eglext.h
New eglext.h has the function pointer typedef corrected to end in PROC
like everything else. We'd like to build against both old and new
headers (at least for a while), while using the idiomatic PROC name in
the actual code.
To do this, before including any headers, tell the preprocessor to
substitute the ...PROC string for any ...NOK string it encounters.
Against old headers this will correct the typedef to the standard form;
against new headers, it will do nothing.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
-rw-r--r-- | tests/egl/egl-nok-swap-region.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/egl/egl-nok-swap-region.c b/tests/egl/egl-nok-swap-region.c index 075df9762..6512b6b80 100644 --- a/tests/egl/egl-nok-swap-region.c +++ b/tests/egl/egl-nok-swap-region.c @@ -28,6 +28,7 @@ * Test EGL_NOK_swap_region. */ +#define PFNEGLSWAPBUFFERSREGIONNOK PFNEGLSWAPBUFFERSREGIONNOKPROC #include "piglit-util-gl.h" #include "egl-util.h" @@ -64,10 +65,10 @@ draw(struct egl_state *state) { 55, 55, red }, { 55, state->height - 55, green }, }; - PFNEGLSWAPBUFFERSREGIONNOK swap_buffers_region; + PFNEGLSWAPBUFFERSREGIONNOKPROC swap_buffers_region; int i; - swap_buffers_region = (PFNEGLSWAPBUFFERSREGIONNOK) + swap_buffers_region = (PFNEGLSWAPBUFFERSREGIONNOKPROC) eglGetProcAddress("eglSwapBuffersRegionNOK"); if (swap_buffers_region == NULL) { |