[Mesa-dev] [PATCH 1/3] dri: add dri_get_extensions_name(..) helper
Emil Velikov
emil.l.velikov at gmail.com
Thu Nov 3 16:02:05 UTC 2016
On 3 November 2016 at 14:25, Christian Gmeiner
<christian.gmeiner at gmail.com> wrote:
> 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;
> +
asprintf is a GNU extension and is missing on MSVC at least. I'm not
sure if the includes are ok/needed.
Please move that anywhere in src/loader/ - be that new or existing file.
Thanks
Emil
More information about the mesa-dev
mailing list