diff --git a/gfx/context/drm_egl_ctx.c b/gfx/context/drm_egl_ctx.c index 174032debb..797f5bd32d 100644 --- a/gfx/context/drm_egl_ctx.c +++ b/gfx/context/drm_egl_ctx.c @@ -411,7 +411,7 @@ static bool gfx_ctx_set_video_mode( // GLES 2.0+. Don't use for any other API. const EGLint gles_context_attribs[] = { - EGL_CONTEXT_CLIENT_VERSION, g_major ? g_major : 2, + EGL_CONTEXT_CLIENT_VERSION, g_major ? (EGLint)g_major : 2, EGL_NONE }; diff --git a/gfx/context/xegl_ctx.c b/gfx/context/xegl_ctx.c index f6b69941e3..a20999295f 100644 --- a/gfx/context/xegl_ctx.c +++ b/gfx/context/xegl_ctx.c @@ -348,6 +348,12 @@ static bool gfx_ctx_set_video_mode( int (*old_handler)(Display*, XErrorEvent*) = NULL; + // GLES 2.0+. Don't use for any other API. + const EGLint egl_ctx_gles_attribs[] = { + EGL_CONTEXT_CLIENT_VERSION, g_major ? (EGLint)g_major : 2, + EGL_NONE, + }; + EGLint vid; if (!eglGetConfigAttrib(g_egl_dpy, g_config, EGL_NATIVE_VISUAL_ID, &vid)) goto error; @@ -405,12 +411,6 @@ static bool gfx_ctx_set_video_mode( CWBorderPixel | CWColormap | CWEventMask | (true_full ? CWOverrideRedirect : 0), &swa); XSetWindowBackground(g_dpy, g_win, 0); - // GLES 2.0+. Don't use for any other API. - const EGLint egl_ctx_gles_attribs[] = { - EGL_CONTEXT_CLIENT_VERSION, g_major ? g_major : 2, - EGL_NONE, - }; - g_egl_ctx = eglCreateContext(g_egl_dpy, g_config, EGL_NO_CONTEXT, (g_api == GFX_CTX_OPENGL_ES_API) ? egl_ctx_gles_attribs : NULL); diff --git a/gfx/gl.c b/gfx/gl.c index 337e9bb8bb..a49a38e702 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -2426,7 +2426,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer) gl_frame(gl, NULL, 0, 0, 0, NULL); uint8_t *dst = buffer; - const uint8_t *src = gl->readback_buffer_screenshot; + const uint8_t *src = (const uint8_t*)gl->readback_buffer_screenshot; unsigned i; for (i = 0; i < num_pixels; i++, dst += 3, src += 4) { diff --git a/git_version.c b/git_version.c index 83a32fc82e..92e2fe0c06 100644 --- a/git_version.c +++ b/git_version.c @@ -13,5 +13,6 @@ * If not, see . */ +#include "git_version.h" const char rarch_git_version[] = GIT_VERSION; diff --git a/git_version.h b/git_version.h index e406cff7ac..01a445ec5c 100644 --- a/git_version.h +++ b/git_version.h @@ -16,8 +16,16 @@ #ifndef RARCH_VERSION_H__ #define RARCH_VERSION_H__ +#ifdef __cplusplus +extern "C" { +#endif + // Put this in a separate file so we don't have to rebuilt retroarch.c every single build. extern const char rarch_git_version[]; +#ifdef __cplusplus +} +#endif + #endif