diff options
author | Eric Anholt <eric@anholt.net> | 2014-03-18 17:17:15 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-03-19 17:39:52 -0700 |
commit | 037ac7f56646a906326dd35567410045e4a1f314 (patch) | |
tree | b010140d3ecc7e1008ce34e2b26476ba8ed963ad /test/dlwrap.h | |
parent | dae231680e2d400560a74518dcfb4dacb2a474a3 (diff) | |
download | libepoxy-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.h | 10 |
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 |