+/**
+ * Wrapper for dlsym() that does a cast to a generic function type,
+ * rather than a void *. This reduces the number of warnings that are
+ * generated.
+ */
+static inline GenericFunc
+_mesa_dlsym(void *handle, const char *fname)
+{
+ union {
+ void *v;
+ GenericFunc f;
+ } u;
+#if defined(HAVE_DLOPEN)
+ u.v = dlsym(handle, fname);
+#elif defined(_WIN32)
+ u.v = (void *) GetProcAddress(handle, fname);
+#else
+ u.v = NULL;
+#endif
+ return u.f;
+}