[Mesa-dev] [PATCH 1/3] dri: add dri_get_extensions_name(..) helper
Christian Gmeiner
christian.gmeiner at gmail.com
Thu Nov 3 14:25:20 UTC 2016
Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
include/GL/internal/dri_interface.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index d0b1bc6..36ba65e 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -40,6 +40,9 @@
#ifndef DRI_INTERFACE_H
#define DRI_INTERFACE_H
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
#ifdef HAVE_LIBDRM
#include <drm.h>
#else
@@ -606,6 +609,17 @@ struct __DRIuseInvalidateExtensionRec {
*/
#define __DRI_DRIVER_GET_EXTENSIONS "__driDriverGetExtensions"
+static inline char *
+dri_get_extensions_name(const char *driver_name)
+{
+ char *name = NULL;
+
+ if (asprintf(&name, "%s_%s", __DRI_DRIVER_GET_EXTENSIONS, driver_name) < 0)
+ return NULL;
+
+ return name;
+}
+
/**
* Tokens for __DRIconfig attribs. A number of attributes defined by
* GLX or EGL standards are not in the table, as they must be provided
--
2.7.4
More information about the mesa-dev
mailing list