X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glwrap.h;h=bd2e265dac5e9d26c7d7a12821e08ea9f0c0e40a;hb=ca92cd15c67e52a9ed2d390f946b750e777b47d7;hp=9195007c4b51b15cd8eb38eea9439ee0c15d4579;hpb=c0c549440d852153d1777eca3fa962c1b70483b3;p=fips diff --git a/glwrap.h b/glwrap.h index 9195007..bd2e265 100644 --- a/glwrap.h +++ b/glwrap.h @@ -37,4 +37,12 @@ glwrap_lookup (char *name); real_ ## function(__VA_ARGS__); \ } while (0); +/* As GLWRAP_DEFER, but also set 'ret' to the return value */ +#define GLWRAP_DEFER_WITH_RETURN(ret, function,...) do { \ + static typeof(&function) real_ ## function; \ + if (! real_ ## function) \ + real_ ## function = glwrap_lookup (#function); \ + (ret) = real_ ## function(__VA_ARGS__); \ +} while (0); + #endif