From f7ca633e49f6f490efd875f63708017bdbb0084c Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Wed, 4 Jun 2014 11:15:53 +0200 Subject: emulator/opengl: Fix GPU emulation library crash on Windows. The definitions of two EGL translator functions were missing EGLAPI / EGLAPIENTRY macros. On Windows, these enforces the __stdcall procedure call modifier, which changes the way the stack pointer is modified on function exit. Without this patch, a call to these function will result in a corrupted stack pointer in the caller, quickly followed by a random crash. BUG=15402623 Change-Id: Ia0f7ebef29e1252086fb59ebf2e6f907c2a69487 --- emulator/opengl/host/libs/Translator/EGL/EglImp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'emulator') diff --git a/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp b/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp index 58180ed..8896698 100644 --- a/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp +++ b/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp @@ -1022,7 +1022,7 @@ void detachEGLImage(unsigned int imageId) } -EGLImageKHR eglCreateImageKHR(EGLDisplay display, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) +EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR(EGLDisplay display, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) { VALIDATE_DISPLAY(display); VALIDATE_CONTEXT(context); @@ -1059,7 +1059,7 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay display, EGLContext context, EGLenum ta } -EGLBoolean eglDestroyImageKHR(EGLDisplay display, EGLImageKHR image) +EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR(EGLDisplay display, EGLImageKHR image) { VALIDATE_DISPLAY(display); return dpy->destroyImageKHR(image) ? EGL_TRUE:EGL_FALSE; -- cgit v1.1