Skip to content

Commit 13faddb

Browse files
evelikov-workevelikov
authored andcommitted
mesa_glinterop: remove mesa_glinterop typedefs
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. v2: Kill the typedef alltogether, as per Marek. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96236 Cc: Vinson Lee <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
1 parent d43c894 commit 13faddb

File tree

11 files changed

+60
-60
lines changed

11 files changed

+60
-60
lines changed

include/GL/internal/dri_interface.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -401,21 +401,21 @@ struct __DRI2fenceExtensionRec {
401401
#define __DRI2_INTEROP "DRI2_Interop"
402402
#define __DRI2_INTEROP_VERSION 1
403403

404-
typedef struct _mesa_glinterop_device_info mesa_glinterop_device_info;
405-
typedef struct _mesa_glinterop_export_in mesa_glinterop_export_in;
406-
typedef struct _mesa_glinterop_export_out mesa_glinterop_export_out;
404+
struct mesa_glinterop_device_info;
405+
struct mesa_glinterop_export_in;
406+
struct mesa_glinterop_export_out;
407407

408408
struct __DRI2interopExtensionRec {
409409
__DRIextension base;
410410

411411
/** Same as MesaGLInterop*QueryDeviceInfo. */
412412
int (*query_device_info)(__DRIcontext *ctx,
413-
mesa_glinterop_device_info *out);
413+
struct mesa_glinterop_device_info *out);
414414

415415
/** Same as MesaGLInterop*ExportObject. */
416416
int (*export_object)(__DRIcontext *ctx,
417-
mesa_glinterop_export_in *in,
418-
mesa_glinterop_export_out *out);
417+
struct mesa_glinterop_export_in *in,
418+
struct mesa_glinterop_export_out *out);
419419
};
420420

421421
/*@}*/

include/GL/mesa_glinterop.h

+18-18
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ enum {
9292
/**
9393
* Device information returned by Mesa.
9494
*/
95-
typedef struct _mesa_glinterop_device_info {
95+
struct mesa_glinterop_device_info {
9696
/* The caller should set this to the version of the struct they support */
9797
/* The callee will overwrite it if it supports a lower version.
9898
*
@@ -113,14 +113,14 @@ typedef struct _mesa_glinterop_device_info {
113113
uint32_t device_id;
114114

115115
/* Structure version 1 ends here. */
116-
} mesa_glinterop_device_info;
116+
};
117117

118118
#define MESA_GLINTEROP_EXPORT_IN_VERSION 1
119119

120120
/**
121121
* Input parameters to Mesa interop export functions.
122122
*/
123-
typedef struct _mesa_glinterop_export_in {
123+
struct mesa_glinterop_export_in {
124124
/* The caller should set this to the version of the struct they support */
125125
/* The callee will overwrite it if it supports a lower version.
126126
*
@@ -178,14 +178,14 @@ typedef struct _mesa_glinterop_export_in {
178178
*/
179179
void *out_driver_data;
180180
/* Structure version 1 ends here. */
181-
} mesa_glinterop_export_in;
181+
};
182182

183183
#define MESA_GLINTEROP_EXPORT_OUT_VERSION 1
184184

185185
/**
186186
* Outputs of Mesa interop export functions.
187187
*/
188-
typedef struct _mesa_glinterop_export_out {
188+
struct mesa_glinterop_export_out {
189189
/* The caller should set this to the version of the struct they support */
190190
/* The callee will overwrite it if it supports a lower version.
191191
*
@@ -233,7 +233,7 @@ typedef struct _mesa_glinterop_export_out {
233233
/* The number of bytes written to out_driver_data. */
234234
uint32_t out_driver_data_written;
235235
/* Structure version 1 ends here. */
236-
} mesa_glinterop_export_out;
236+
};
237237

238238

239239
/**
@@ -247,7 +247,7 @@ typedef struct _mesa_glinterop_export_out {
247247
*/
248248
int
249249
MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
250-
mesa_glinterop_device_info *out);
250+
struct mesa_glinterop_device_info *out);
251251

252252

253253
/**
@@ -256,7 +256,7 @@ MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
256256
*/
257257
int
258258
MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
259-
mesa_glinterop_device_info *out);
259+
struct mesa_glinterop_device_info *out);
260260

261261

262262
/**
@@ -272,8 +272,8 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
272272
*/
273273
int
274274
MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
275-
mesa_glinterop_export_in *in,
276-
mesa_glinterop_export_out *out);
275+
struct mesa_glinterop_export_in *in,
276+
struct mesa_glinterop_export_out *out);
277277

278278

279279
/**
@@ -282,20 +282,20 @@ MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
282282
*/
283283
int
284284
MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
285-
mesa_glinterop_export_in *in,
286-
mesa_glinterop_export_out *out);
285+
struct mesa_glinterop_export_in *in,
286+
struct mesa_glinterop_export_out *out);
287287

288288

289289
typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(Display *dpy, GLXContext context,
290-
mesa_glinterop_device_info *out);
290+
struct mesa_glinterop_device_info *out);
291291
typedef int (PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, EGLContext context,
292-
mesa_glinterop_device_info *out);
292+
struct mesa_glinterop_device_info *out);
293293
typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(Display *dpy, GLXContext context,
294-
mesa_glinterop_export_in *in,
295-
mesa_glinterop_export_out *out);
294+
struct mesa_glinterop_export_in *in,
295+
struct mesa_glinterop_export_out *out);
296296
typedef int (PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext context,
297-
mesa_glinterop_export_in *in,
298-
mesa_glinterop_export_out *out);
297+
struct mesa_glinterop_export_in *in,
298+
struct mesa_glinterop_export_out *out);
299299

300300
#ifdef __cplusplus
301301
}

src/egl/drivers/dri2/egl_dri2.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2690,7 +2690,7 @@ dri2_server_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync)
26902690

26912691
static int
26922692
dri2_interop_query_device_info(_EGLDisplay *dpy, _EGLContext *ctx,
2693-
mesa_glinterop_device_info *out)
2693+
struct mesa_glinterop_device_info *out)
26942694
{
26952695
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
26962696
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
@@ -2703,8 +2703,8 @@ dri2_interop_query_device_info(_EGLDisplay *dpy, _EGLContext *ctx,
27032703

27042704
static int
27052705
dri2_interop_export_object(_EGLDisplay *dpy, _EGLContext *ctx,
2706-
mesa_glinterop_export_in *in,
2707-
mesa_glinterop_export_out *out)
2706+
struct mesa_glinterop_export_in *in,
2707+
struct mesa_glinterop_export_out *out)
27082708
{
27092709
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
27102710
struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);

src/egl/main/eglapi.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ _eglLockDisplayInterop(EGLDisplay dpy, EGLContext context,
19391939

19401940
int
19411941
MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
1942-
mesa_glinterop_device_info *out)
1942+
struct mesa_glinterop_device_info *out)
19431943
{
19441944
_EGLDisplay *disp;
19451945
_EGLDriver *drv;
@@ -1961,8 +1961,8 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
19611961

19621962
int
19631963
MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
1964-
mesa_glinterop_export_in *in,
1965-
mesa_glinterop_export_out *out)
1964+
struct mesa_glinterop_export_in *in,
1965+
struct mesa_glinterop_export_out *out)
19661966
{
19671967
_EGLDisplay *disp;
19681968
_EGLDriver *drv;

src/egl/main/eglapi.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ extern "C" {
4242
typedef void (*_EGLProc)(void);
4343

4444
struct wl_display;
45-
typedef struct _mesa_glinterop_device_info mesa_glinterop_device_info;
46-
typedef struct _mesa_glinterop_export_in mesa_glinterop_export_in;
47-
typedef struct _mesa_glinterop_export_out mesa_glinterop_export_out;
45+
struct mesa_glinterop_device_info;
46+
struct mesa_glinterop_export_in;
47+
struct mesa_glinterop_export_out;
4848

4949
/**
5050
* The API dispatcher jumps through these functions
@@ -193,10 +193,10 @@ struct _egl_api
193193
EGLint *strides, EGLint *offsets);
194194

195195
int (*GLInteropQueryDeviceInfo)(_EGLDisplay *dpy, _EGLContext *ctx,
196-
mesa_glinterop_device_info *out);
196+
struct mesa_glinterop_device_info *out);
197197
int (*GLInteropExportObject)(_EGLDisplay *dpy, _EGLContext *ctx,
198-
mesa_glinterop_export_in *in,
199-
mesa_glinterop_export_out *out);
198+
struct mesa_glinterop_export_in *in,
199+
struct mesa_glinterop_export_out *out);
200200
};
201201

202202

src/gallium/state_trackers/dri/dri2.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ static const __DRIrobustnessExtension dri2Robustness = {
14881488

14891489
static int
14901490
dri2_interop_query_device_info(__DRIcontext *_ctx,
1491-
mesa_glinterop_device_info *out)
1491+
struct mesa_glinterop_device_info *out)
14921492
{
14931493
struct pipe_screen *screen = dri_context(_ctx)->st->pipe->screen;
14941494

@@ -1512,8 +1512,8 @@ dri2_interop_query_device_info(__DRIcontext *_ctx,
15121512

15131513
static int
15141514
dri2_interop_export_object(__DRIcontext *_ctx,
1515-
mesa_glinterop_export_in *in,
1516-
mesa_glinterop_export_out *out)
1515+
struct mesa_glinterop_export_in *in,
1516+
struct mesa_glinterop_export_out *out)
15171517
{
15181518
struct st_context_iface *st = dri_context(_ctx)->st;
15191519
struct pipe_screen *screen = st->pipe->screen;

src/glx/dri2_priv.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ dri2_query_renderer_string(struct glx_screen *base, int attribute,
7272

7373
_X_HIDDEN int
7474
dri2_interop_query_device_info(struct glx_context *ctx,
75-
mesa_glinterop_device_info *out);
75+
struct mesa_glinterop_device_info *out);
7676

7777
_X_HIDDEN int
7878
dri2_interop_export_object(struct glx_context *ctx,
79-
mesa_glinterop_export_in *in,
80-
mesa_glinterop_export_out *out);
79+
struct mesa_glinterop_export_in *in,
80+
struct mesa_glinterop_export_out *out);
8181

8282
#ifdef __cplusplus
8383
}

src/glx/dri3_priv.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ dri3_query_renderer_string(struct glx_screen *base, int attribute,
135135

136136
_X_HIDDEN int
137137
dri3_interop_query_device_info(struct glx_context *ctx,
138-
mesa_glinterop_device_info *out);
138+
struct mesa_glinterop_device_info *out);
139139

140140
_X_HIDDEN int
141141
dri3_interop_export_object(struct glx_context *ctx,
142-
mesa_glinterop_export_in *in,
143-
mesa_glinterop_export_out *out);
142+
struct mesa_glinterop_export_in *in,
143+
struct mesa_glinterop_export_out *out);

src/glx/dri_common_interop.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
_X_HIDDEN int
3636
dri2_interop_query_device_info(struct glx_context *ctx,
37-
mesa_glinterop_device_info *out)
37+
struct mesa_glinterop_device_info *out)
3838
{
3939
struct dri2_screen *psc = (struct dri2_screen*)ctx->psc;
4040
struct dri2_context *drictx = (struct dri2_context*)ctx;
@@ -47,8 +47,8 @@ dri2_interop_query_device_info(struct glx_context *ctx,
4747

4848
_X_HIDDEN int
4949
dri2_interop_export_object(struct glx_context *ctx,
50-
mesa_glinterop_export_in *in,
51-
mesa_glinterop_export_out *out)
50+
struct mesa_glinterop_export_in *in,
51+
struct mesa_glinterop_export_out *out)
5252
{
5353
struct dri2_screen *psc = (struct dri2_screen*)ctx->psc;
5454
struct dri2_context *drictx = (struct dri2_context*)ctx;
@@ -63,7 +63,7 @@ dri2_interop_export_object(struct glx_context *ctx,
6363

6464
_X_HIDDEN int
6565
dri3_interop_query_device_info(struct glx_context *ctx,
66-
mesa_glinterop_device_info *out)
66+
struct mesa_glinterop_device_info *out)
6767
{
6868
struct dri3_screen *psc = (struct dri3_screen*)ctx->psc;
6969
struct dri3_context *drictx = (struct dri3_context*)ctx;
@@ -76,8 +76,8 @@ dri3_interop_query_device_info(struct glx_context *ctx,
7676

7777
_X_HIDDEN int
7878
dri3_interop_export_object(struct glx_context *ctx,
79-
mesa_glinterop_export_in *in,
80-
mesa_glinterop_export_out *out)
79+
struct mesa_glinterop_export_in *in,
80+
struct mesa_glinterop_export_out *out)
8181
{
8282
struct dri3_screen *psc = (struct dri3_screen*)ctx->psc;
8383
struct dri3_context *drictx = (struct dri3_context*)ctx;

src/glx/glxclient.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ typedef struct __GLXattributeMachineRec
218218
__GLXattribute **stackPointer;
219219
} __GLXattributeMachine;
220220

221-
typedef struct _mesa_glinterop_device_info mesa_glinterop_device_info;
222-
typedef struct _mesa_glinterop_export_in mesa_glinterop_export_in;
223-
typedef struct _mesa_glinterop_export_out mesa_glinterop_export_out;
221+
struct mesa_glinterop_device_info;
222+
struct mesa_glinterop_export_in;
223+
struct mesa_glinterop_export_out;
224224

225225
struct glx_context_vtable {
226226
void (*destroy)(struct glx_context *ctx);
@@ -237,10 +237,10 @@ struct glx_context_vtable {
237237
void (*release_tex_image)(Display * dpy, GLXDrawable drawable, int buffer);
238238
void * (*get_proc_address)(const char *symbol);
239239
int (*interop_query_device_info)(struct glx_context *ctx,
240-
mesa_glinterop_device_info *out);
240+
struct mesa_glinterop_device_info *out);
241241
int (*interop_export_object)(struct glx_context *ctx,
242-
mesa_glinterop_export_in *in,
243-
mesa_glinterop_export_out *out);
242+
struct mesa_glinterop_export_in *in,
243+
struct mesa_glinterop_export_out *out);
244244
};
245245

246246
/**

src/glx/glxcmds.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@ __glXGetUST(int64_t * ust)
26972697

26982698
int
26992699
MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
2700-
mesa_glinterop_device_info *out)
2700+
struct mesa_glinterop_device_info *out)
27012701
{
27022702
struct glx_context *gc = (struct glx_context*)context;
27032703
int ret;
@@ -2721,8 +2721,8 @@ MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
27212721

27222722
int
27232723
MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
2724-
mesa_glinterop_export_in *in,
2725-
mesa_glinterop_export_out *out)
2724+
struct mesa_glinterop_export_in *in,
2725+
struct mesa_glinterop_export_out *out)
27262726
{
27272727
struct glx_context *gc = (struct glx_context*)context;
27282728
int ret;

0 commit comments

Comments
 (0)