X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glwrap.h;fp=glwrap.h;h=bd2e265dac5e9d26c7d7a12821e08ea9f0c0e40a;hb=65892e28812cc06cceba26c22caca6e6b83960e0;hp=9195007c4b51b15cd8eb38eea9439ee0c15d4579;hpb=377222f13763b1b7b78bf558ab9ac8b70535c96d;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