[Mesa-dev] [PATCH 14/18] mesa_glinterop: remove mesa_glinterop typedefs

Marek Olšák maraeo at gmail.com
Fri May 27 15:03:24 UTC 2016


You don't need to keep the underscore at the beginning of the type
names anymore.

Marek

On Fri, May 27, 2016 at 4:35 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> As is there are two places that do the typedefs - dri_interface.h and
> this header. As we cannot include the former in here, just drop the
> typedefs and use the struct directly (as needed).
>
> This is required because typedef redefinition is C11 feature which is
> not supported on all the versions of GCC used to build mesa.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96236
> Cc: Vinson Lee <vlee at freedesktop.org>
> Cc: Marek Olšák <marek.olsak at amd.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Vison, can you please test this ?
> ---
>  include/GL/mesa_glinterop.h | 36 ++++++++++++++++++------------------
>  src/egl/main/eglapi.c       |  6 +++---
>  src/glx/glxcmds.c           |  6 +++---
>  3 files changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/include/GL/mesa_glinterop.h b/include/GL/mesa_glinterop.h
> index b805d63..d44e385 100644
> --- a/include/GL/mesa_glinterop.h
> +++ b/include/GL/mesa_glinterop.h
> @@ -92,7 +92,7 @@ enum {
>  /**
>   * Device information returned by Mesa.
>   */
> -typedef struct _mesa_glinterop_device_info {
> +struct _mesa_glinterop_device_info {
>     /* The caller should set this to the version of the struct they support */
>     /* The callee will overwrite it if it supports a lower version.
>      *
> @@ -113,14 +113,14 @@ typedef struct _mesa_glinterop_device_info {
>     uint32_t device_id;
>
>     /* Structure version 1 ends here. */
> -} mesa_glinterop_device_info;
> +};
>
>  #define MESA_GLINTEROP_EXPORT_IN_VERSION 1
>
>  /**
>   * Input parameters to Mesa interop export functions.
>   */
> -typedef struct _mesa_glinterop_export_in {
> +struct _mesa_glinterop_export_in {
>     /* The caller should set this to the version of the struct they support */
>     /* The callee will overwrite it if it supports a lower version.
>      *
> @@ -178,14 +178,14 @@ typedef struct _mesa_glinterop_export_in {
>      */
>     void *out_driver_data;
>     /* Structure version 1 ends here. */
> -} mesa_glinterop_export_in;
> +};
>
>  #define MESA_GLINTEROP_EXPORT_OUT_VERSION 1
>
>  /**
>   * Outputs of Mesa interop export functions.
>   */
> -typedef struct _mesa_glinterop_export_out {
> +struct _mesa_glinterop_export_out {
>     /* The caller should set this to the version of the struct they support */
>     /* The callee will overwrite it if it supports a lower version.
>      *
> @@ -233,7 +233,7 @@ typedef struct _mesa_glinterop_export_out {
>     /* The number of bytes written to out_driver_data. */
>     uint32_t out_driver_data_written;
>     /* Structure version 1 ends here. */
> -} mesa_glinterop_export_out;
> +};
>
>
>  /**
> @@ -247,7 +247,7 @@ typedef struct _mesa_glinterop_export_out {
>   */
>  int
>  MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
> -                                mesa_glinterop_device_info *out);
> +                                struct _mesa_glinterop_device_info *out);
>
>
>  /**
> @@ -256,7 +256,7 @@ MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
>   */
>  int
>  MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
> -                                mesa_glinterop_device_info *out);
> +                                struct _mesa_glinterop_device_info *out);
>
>
>  /**
> @@ -272,8 +272,8 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
>   */
>  int
>  MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
> -                             mesa_glinterop_export_in *in,
> -                             mesa_glinterop_export_out *out);
> +                             struct _mesa_glinterop_export_in *in,
> +                             struct _mesa_glinterop_export_out *out);
>
>
>  /**
> @@ -282,20 +282,20 @@ MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
>   */
>  int
>  MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
> -                             mesa_glinterop_export_in *in,
> -                             mesa_glinterop_export_out *out);
> +                             struct _mesa_glinterop_export_in *in,
> +                             struct _mesa_glinterop_export_out *out);
>
>
>  typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(Display *dpy, GLXContext context,
> -                                                     mesa_glinterop_device_info *out);
> +                                                     struct _mesa_glinterop_device_info *out);
>  typedef int (PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, EGLContext context,
> -                                                     mesa_glinterop_device_info *out);
> +                                                     struct _mesa_glinterop_device_info *out);
>  typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(Display *dpy, GLXContext context,
> -                                                  mesa_glinterop_export_in *in,
> -                                                  mesa_glinterop_export_out *out);
> +                                                  struct _mesa_glinterop_export_in *in,
> +                                                  struct _mesa_glinterop_export_out *out);
>  typedef int (PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext context,
> -                                                  mesa_glinterop_export_in *in,
> -                                                  mesa_glinterop_export_out *out);
> +                                                  struct _mesa_glinterop_export_in *in,
> +                                                  struct _mesa_glinterop_export_out *out);
>
>  #ifdef __cplusplus
>  }
> diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
> index 098bed0..76f9004 100644
> --- a/src/egl/main/eglapi.c
> +++ b/src/egl/main/eglapi.c
> @@ -1939,7 +1939,7 @@ _eglLockDisplayInterop(EGLDisplay dpy, EGLContext context,
>
>  int
>  MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
> -                                mesa_glinterop_device_info *out)
> +                                struct _mesa_glinterop_device_info *out)
>  {
>     _EGLDisplay *disp;
>     _EGLDriver *drv;
> @@ -1961,8 +1961,8 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
>
>  int
>  MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
> -                             mesa_glinterop_export_in *in,
> -                             mesa_glinterop_export_out *out)
> +                             struct _mesa_glinterop_export_in *in,
> +                             struct _mesa_glinterop_export_out *out)
>  {
>     _EGLDisplay *disp;
>     _EGLDriver *drv;
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index 589a87a..a8fe182 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -2697,7 +2697,7 @@ __glXGetUST(int64_t * ust)
>
>  int
>  MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
> -                                mesa_glinterop_device_info *out)
> +                                struct _mesa_glinterop_device_info *out)
>  {
>     struct glx_context *gc = (struct glx_context*)context;
>     int ret;
> @@ -2721,8 +2721,8 @@ MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
>
>  int
>  MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
> -                             mesa_glinterop_export_in *in,
> -                             mesa_glinterop_export_out *out)
> +                             struct _mesa_glinterop_export_in *in,
> +                             struct _mesa_glinterop_export_out *out)
>  {
>     struct glx_context *gc = (struct glx_context*)context;
>     int ret;
> --
> 2.8.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list