diff --git a/gfx/common/egl_common.h b/gfx/common/egl_common.h index 2d6bad7aac..81bbde23cc 100644 --- a/gfx/common/egl_common.h +++ b/gfx/common/egl_common.h @@ -25,7 +25,11 @@ #include "../video_context_driver.h" -volatile sig_atomic_t g_egl_quit; +#ifdef __cplusplus +extern "C" { +#endif + +extern volatile sig_atomic_t g_egl_quit; extern EGLContext g_egl_ctx; extern EGLContext g_egl_hw_ctx; @@ -60,4 +64,8 @@ bool egl_create_context(EGLint *egl_attribs); bool egl_create_surface(NativeWindowType native_window); +#ifdef __cplusplus +} +#endif + #endif diff --git a/gfx/drivers_context/drm_egl_ctx.c b/gfx/drivers_context/drm_egl_ctx.c index 4e60460bb1..bddcac0561 100644 --- a/gfx/drivers_context/drm_egl_ctx.c +++ b/gfx/drivers_context/drm_egl_ctx.c @@ -626,7 +626,7 @@ static bool gfx_ctx_drm_egl_set_video_mode(void *data, EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT, EGL_NONE, }; - + EGLint *egl_attribs_ptr = NULL; const EGLint *attrib_ptr; EGLint major, minor, n, egl_attribs[16], *attr; float refresh_mod; @@ -729,8 +729,8 @@ static bool gfx_ctx_drm_egl_set_video_mode(void *data, goto error; } - attr = egl_fill_attribs(egl_attribs); - EGLint *egl_attribs_ptr = &egl_attribs[0]; + attr = egl_fill_attribs(egl_attribs); + egl_attribs_ptr = &egl_attribs[0]; if (!egl_create_context((attr != egl_attribs_ptr) ? egl_attribs_ptr : NULL)) {