summaryrefslogtreecommitdiff
path: root/test/dlwrap.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-03-18 17:17:15 -0700
committerEric Anholt <eric@anholt.net>2014-03-19 17:39:52 -0700
commit037ac7f56646a906326dd35567410045e4a1f314 (patch)
treeb010140d3ecc7e1008ce34e2b26476ba8ed963ad /test/dlwrap.h
parentdae231680e2d400560a74518dcfb4dacb2a474a3 (diff)
downloadlibepoxy-037ac7f56646a906326dd35567410045e4a1f314.tar.gz
Add a test for EGL and GLX returning different function pointers.
This is the case on the nvidia binary driver's GL, or when you've got a system mixing nvidia binary GL and Mesa EGL.
Diffstat (limited to 'test/dlwrap.h')
-rw-r--r--test/dlwrap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/dlwrap.h b/test/dlwrap.h
index 7e943e0..39ec9ec 100644
--- a/test/dlwrap.h
+++ b/test/dlwrap.h
@@ -53,5 +53,15 @@ dlwrap_dlopen_libfips(void);
void *
dlwrap_real_dlsym(void *handle, const char *symbol);
+#define DEFER_TO_GL(library, func, name, args) \
+({ \
+ void *lib = dlwrap_real_dlopen(library, RTLD_LAZY | RTLD_LOCAL); \
+ typeof(&func) real_func = dlwrap_real_dlsym(lib, name); \
+ /* gcc extension -- func's return value is the return value of \
+ * the statement. \
+ */ \
+ real_func args; \
+})
+
#endif