On 8 September 2016 at 05:06, Adam Jackson <[email protected]> wrote: > On Thu, 2016-09-08 at 03:42 +0100, Emil Velikov wrote: >> > On 7 September 2016 at 21:50, Adam Jackson <[email protected]> wrote: >> > index 075df97..6512b6b 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) > >> It could be the late hour but things look backwards. >> Namely: Using the PROC version yet defining the non-PROC one. > > Yes, we're defining the non-PROC string to be replaced with the PROCful > string, such that when the preprocessor subsequently sees... > > typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) > (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* > rects); > > ... it swaps in the ...PROC string, and the PROCful version is the type > def'd, and then that is what the rest of the test uses. If on the other > hand the new headers are used, then no typedef named ...NOK is > declared, and nothing happens. > >> Please don't forget the ifndef PFN... guard. > > It's the first preprocessor statement in the only compilation unit, an > ifndef would do nothing. > Thanks a million for clarifying, Adam !
Silly brain was claiming that the define is after the includes, thus the complete misunderstanding. If you haven't pushed this already, can you please copy/paste (part of) the above description in the commit log and Reviewed-by: Emil Velikov <[email protected]> Thanks again, Emil _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
