]> git.cworth.org Git - fips/blobdiff - glwrap.h
Add explicit link to libpthread, to work around debugging issues
[fips] / glwrap.h
index 9195007c4b51b15cd8eb38eea9439ee0c15d4579..6acf3fcdb98cc00c86f690d217a070ddc1d0a96e 100644 (file)
--- a/glwrap.h
+++ b/glwrap.h
 void *
 glwrap_lookup (char *name);
 
+/* Register a dlopened handle to be used by glwrap. */
+void
+glwrap_set_gl_handle (void *handle);
+
 /* Defer to the real 'function' (from libGL.so) to do the real work.
  * The symbol is looked up once and cached in a static variable for
  * future uses.
@@ -37,4 +41,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