Skip to content
Permalink
Browse files

Fixed ISO C99 compatibility

SDL now builds with gcc 7.2 with the following command line options:
-Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
  • Loading branch information
slouken committed Jan 31, 2018
1 parent e1d8598 commit 90e72bf4e2696229ffe09cd208d5420dcb9d089a
Showing with 176 additions and 196 deletions.
  1. +5 −5 src/audio/SDL_audio.c
  2. +1 −1 src/audio/directsound/SDL_directsound.c
  3. +2 −2 src/audio/wasapi/SDL_wasapi_win32.c
  4. +1 −1 src/core/linux/SDL_dbus.c
  5. +5 −5 src/core/windows/SDL_xinput.c
  6. +1 −1 src/dynapi/SDL_dynapi.c
  7. +2 −2 src/events/SDL_quit.c
  8. +1 −1 src/filesystem/windows/SDL_sysfilesystem.c
  9. +2 −2 src/render/direct3d11/SDL_render_d3d11.c
  10. +14 −17 src/render/opengl/SDL_render_gl.c
  11. +14 −14 src/render/opengl/SDL_shaders_gl.c
  12. +2 −2 src/render/opengles/SDL_render_gles.c
  13. +3 −4 src/render/opengles2/SDL_render_gles2.c
  14. +1 −5 src/thread/pthread/SDL_systhread.c
  15. +1 −1 src/thread/windows/SDL_systhread.c
  16. +2 −2 src/video/SDL_blit.c
  17. +2 −2 src/video/SDL_egl.c
  18. +2 −2 src/video/SDL_sysvideo.h
  19. +12 −9 src/video/SDL_video.c
  20. +3 −0 src/video/SDL_vulkan_internal.h
  21. +5 −4 src/video/android/SDL_androidvulkan.c
  22. +3 −3 src/video/cocoa/SDL_cocoavulkan.m
  23. +1 −1 src/video/mir/SDL_mirdyn.c
  24. +3 −2 src/video/mir/SDL_mirvideo.c
  25. +5 −5 src/video/mir/SDL_mirvulkan.c
  26. +1 −2 src/video/uikit/SDL_uikitvulkan.m
  27. +3 −3 src/video/wayland/SDL_waylanddatamanager.c
  28. +1 −1 src/video/wayland/SDL_waylanddyn.c
  29. +1 −0 src/video/wayland/SDL_waylandopengles.h
  30. +5 −5 src/video/wayland/SDL_waylandvulkan.c
  31. +3 −1 src/video/windows/SDL_windowsevents.c
  32. +6 −6 src/video/windows/SDL_windowskeyboard.c
  33. +12 −17 src/video/windows/SDL_windowsopengl.c
  34. +7 −9 src/video/windows/SDL_windowsvideo.c
  35. +3 −3 src/video/windows/SDL_windowsvulkan.c
  36. +2 −1 src/video/winrt/SDL_winrtopengles.cpp
  37. +3 −5 src/video/x11/SDL_x11dyn.c
  38. +22 −38 src/video/x11/SDL_x11opengl.c
  39. +9 −7 src/video/x11/SDL_x11vulkan.c
  40. +5 −5 src/video/yuv2rgb/yuv_rgb_sse_func.h
@@ -151,11 +151,11 @@ LoadLibSampleRate(void)
return SDL_FALSE;
}

SRC_src_new = (SRC_STATE* (*)(int converter_type, int channels, int *error))SDL_LoadFunction(SRC_lib, "src_new");
SRC_src_process = (int (*)(SRC_STATE *state, SRC_DATA *data))SDL_LoadFunction(SRC_lib, "src_process");
SRC_src_reset = (int(*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_reset");
SRC_src_delete = (SRC_STATE* (*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_delete");
SRC_src_strerror = (const char* (*)(int error))SDL_LoadFunction(SRC_lib, "src_strerror");
*(void **)&SRC_src_new = SDL_LoadFunction(SRC_lib, "src_new");
*(void **)&SRC_src_process = SDL_LoadFunction(SRC_lib, "src_process");
*(void **)&SRC_src_reset = SDL_LoadFunction(SRC_lib, "src_reset");
*(void **)&SRC_src_delete = SDL_LoadFunction(SRC_lib, "src_delete");
*(void **)&SRC_src_strerror = SDL_LoadFunction(SRC_lib, "src_strerror");

if (!SRC_src_new || !SRC_src_process || !SRC_src_reset || !SRC_src_delete || !SRC_src_strerror) {
SDL_UnloadObject(SRC_lib);
@@ -74,7 +74,7 @@ DSOUND_Load(void)
} else {
/* Now make sure we have DirectX 8 or better... */
#define DSOUNDLOAD(f) { \
p##f = (fn##f) SDL_LoadFunction(DSoundDLL, #f); \
*(void**)&p##f = SDL_LoadFunction(DSoundDLL, #f); \
if (!p##f) loaded = 0; \
}
loaded = 1; /* will reset if necessary. */
@@ -256,8 +256,8 @@ WASAPI_PlatformInit(void)

libavrt = LoadLibraryW(L"avrt.dll"); /* this library is available in Vista and later. No WinXP, so have to LoadLibrary to use it for now! */
if (libavrt) {
pAvSetMmThreadCharacteristicsW = (pfnAvSetMmThreadCharacteristicsW) GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
pAvRevertMmThreadCharacteristics = (pfnAvRevertMmThreadCharacteristics) GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
*(void **)&pAvSetMmThreadCharacteristicsW = GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
*(void **)&pAvRevertMmThreadCharacteristics = GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
}

return 0;
@@ -33,7 +33,7 @@ static int
LoadDBUSSyms(void)
{
#define SDL_DBUS_SYM2(x, y) \
if (!(dbus.x = SDL_LoadFunction(dbus_handle, #y))) return -1
if (!(*(void**)&dbus.x = SDL_LoadFunction(dbus_handle, #y))) return -1

#define SDL_DBUS_SYM(x) \
SDL_DBUS_SYM2(x, dbus_##x)
@@ -104,13 +104,13 @@ WIN_LoadXInputDLL(void)
s_XInputDLLRefCount = 1;

/* 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think... */
SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100);
*(void**)&SDL_XInputGetState = GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100);
if (!SDL_XInputGetState) {
SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState");
*(void**)&SDL_XInputGetState = GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState");
}
SDL_XInputSetState = (XInputSetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState");
SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities");
SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetBatteryInformation" );
*(void**)&SDL_XInputSetState = GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState");
*(void**)&SDL_XInputGetCapabilities = GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities");
*(void**)&SDL_XInputGetBatteryInformation = GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetBatteryInformation" );
if (!SDL_XInputGetState || !SDL_XInputSetState || !SDL_XInputGetCapabilities) {
WIN_UnloadXInputDLL();
return -1;
@@ -263,7 +263,7 @@ SDL_InitDynamicAPILocked(void)
SDL_DYNAPI_ENTRYFN entry = SDL_DYNAPI_entry; /* funcs from here by default. */

if (libname) {
entry = (SDL_DYNAPI_ENTRYFN) get_sdlapi_entry(libname, "SDL_DYNAPI_entry");
*(void **)&entry = get_sdlapi_entry(libname, "SDL_DYNAPI_entry");
if (!entry) {
/* !!! FIXME: fail to startup here instead? */
/* !!! FIXME: definitely warn user. */
@@ -55,7 +55,7 @@ SDL_QuitInit_Internal(void)
struct sigaction action;
sigaction(SIGINT, NULL, &action);
#ifdef HAVE_SA_SIGACTION
if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
if ( action.sa_handler == SIG_DFL && (__sighandler_t)action.sa_sigaction == SIG_DFL ) {
#else
if ( action.sa_handler == SIG_DFL ) {
#endif
@@ -65,7 +65,7 @@ SDL_QuitInit_Internal(void)
sigaction(SIGTERM, NULL, &action);

#ifdef HAVE_SA_SIGACTION
if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
if ( action.sa_handler == SIG_DFL && (__sighandler_t)action.sa_sigaction == SIG_DFL ) {
#else
if ( action.sa_handler == SIG_DFL ) {
#endif
@@ -50,7 +50,7 @@ SDL_GetBasePath(void)
return NULL;
}

pGetModuleFileNameExW = (GetModuleFileNameExW_t)GetProcAddress(psapi, "GetModuleFileNameExW");
*(void**)&pGetModuleFileNameExW = GetProcAddress(psapi, "GetModuleFileNameExW");
if (!pGetModuleFileNameExW) {
WIN_SetError("Couldn't find GetModuleFileNameExW");
FreeLibrary(psapi);
@@ -568,7 +568,7 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer)
goto done;
}

CreateDXGIFactoryFunc = (PFN_CREATE_DXGI_FACTORY)SDL_LoadFunction(data->hDXGIMod, "CreateDXGIFactory");
*(void**)&CreateDXGIFactoryFunc = SDL_LoadFunction(data->hDXGIMod, "CreateDXGIFactory");
if (!CreateDXGIFactoryFunc) {
result = E_FAIL;
goto done;
@@ -580,7 +580,7 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer)
goto done;
}

D3D11CreateDeviceFunc = (PFN_D3D11_CREATE_DEVICE)SDL_LoadFunction(data->hD3D11Mod, "D3D11CreateDevice");
*(void**)D3D11CreateDeviceFunc = SDL_LoadFunction(data->hD3D11Mod, "D3D11CreateDevice");
if (!D3D11CreateDeviceFunc) {
result = E_FAIL;
goto done;
@@ -260,10 +260,8 @@ GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file,

#if 0
#define GL_CheckError(prefix, renderer)
#elif defined(_MSC_VER) || defined(__WATCOMC__)
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __FUNCTION__)
#else
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, SDL_FILE, SDL_LINE, SDL_FUNCTION)
#endif

static int
@@ -274,7 +272,7 @@ GL_LoadFunctions(GL_RenderData * data)
#else
#define SDL_PROC(ret,func,params) \
do { \
data->func = SDL_GL_GetProcAddress(#func); \
*(void **)&data->func = SDL_GL_GetProcAddress(#func); \
if ( ! data->func ) { \
return SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \
} \
@@ -492,7 +490,9 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
data->debug_enabled = SDL_TRUE;
}
if (data->debug_enabled && SDL_GL_ExtensionSupported("GL_ARB_debug_output")) {
PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc;

*(void **)&glDebugMessageCallbackARBFunc = SDL_GL_GetProcAddress("glDebugMessageCallbackARB");

data->GL_ARB_debug_output_supported = SDL_TRUE;
data->glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION_ARB, (GLvoid **)(char *)&data->next_error_callback);
@@ -521,7 +521,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)

/* Check for multitexture support */
if (SDL_GL_ExtensionSupported("GL_ARB_multitexture")) {
data->glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB");
*(void **)&data->glActiveTextureARB = SDL_GL_GetProcAddress("glActiveTextureARB");
if (data->glActiveTextureARB) {
data->GL_ARB_multitexture_supported = SDL_TRUE;
data->glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &data->num_texture_units);
@@ -549,16 +549,11 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)

if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object")) {
data->GL_EXT_framebuffer_object_supported = SDL_TRUE;
data->glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)
SDL_GL_GetProcAddress("glGenFramebuffersEXT");
data->glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)
SDL_GL_GetProcAddress("glDeleteFramebuffersEXT");
data->glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)
SDL_GL_GetProcAddress("glFramebufferTexture2DEXT");
data->glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)
SDL_GL_GetProcAddress("glBindFramebufferEXT");
data->glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)
SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT");
*(void**)&data->glGenFramebuffersEXT = SDL_GL_GetProcAddress("glGenFramebuffersEXT");
*(void**)&data->glDeleteFramebuffersEXT = SDL_GL_GetProcAddress("glDeleteFramebuffersEXT");
*(void**)&data->glFramebufferTexture2DEXT = SDL_GL_GetProcAddress("glFramebufferTexture2DEXT");
*(void**)&data->glBindFramebufferEXT = SDL_GL_GetProcAddress("glBindFramebufferEXT");
*(void**)&data->glCheckFramebufferStatusEXT = SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT");
renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE;
}
data->framebuffers = NULL;
@@ -1615,7 +1610,9 @@ GL_DestroyRenderer(SDL_Renderer * renderer)

GL_ClearErrors(renderer);
if (data->GL_ARB_debug_output_supported) {
PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB");
PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc;

*(void **)&glDebugMessageCallbackARBFunc = SDL_GL_GetProcAddress("glDebugMessageCallbackARB");

/* Uh oh, we don't have a safe way of removing ourselves from the callback chain, if it changed after we set our callback. */
/* For now, just always replace the callback with the original one */
@@ -453,20 +453,20 @@ GL_CreateShaderContext(void)
SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") &&
SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") &&
SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) {
ctx->glGetError = (GLenum (*)(void)) SDL_GL_GetProcAddress("glGetError");
ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB");
ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB");
ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB");
ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB");
ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB");
ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB");
ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB");
ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB");
ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB");
ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB");
ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB");
ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC) SDL_GL_GetProcAddress("glUniform1fARB");
ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB");
*(void**)&ctx->glGetError = SDL_GL_GetProcAddress("glGetError");
*(void **)&ctx->glAttachObjectARB = SDL_GL_GetProcAddress("glAttachObjectARB");
*(void **)&ctx->glCompileShaderARB = SDL_GL_GetProcAddress("glCompileShaderARB");
*(void **)&ctx->glCreateProgramObjectARB = SDL_GL_GetProcAddress("glCreateProgramObjectARB");
*(void **)&ctx->glCreateShaderObjectARB = SDL_GL_GetProcAddress("glCreateShaderObjectARB");
*(void **)&ctx->glDeleteObjectARB = SDL_GL_GetProcAddress("glDeleteObjectARB");
*(void **)&ctx->glGetInfoLogARB = SDL_GL_GetProcAddress("glGetInfoLogARB");
*(void **)&ctx->glGetObjectParameterivARB = SDL_GL_GetProcAddress("glGetObjectParameterivARB");
*(void **)&ctx->glGetUniformLocationARB = SDL_GL_GetProcAddress("glGetUniformLocationARB");
*(void **)&ctx->glLinkProgramARB = SDL_GL_GetProcAddress("glLinkProgramARB");
*(void **)&ctx->glShaderSourceARB = SDL_GL_GetProcAddress("glShaderSourceARB");
*(void **)&ctx->glUniform1iARB = SDL_GL_GetProcAddress("glUniform1iARB");
*(void **)&ctx->glUniform1fARB = SDL_GL_GetProcAddress("glUniform1fARB");
*(void **)&ctx->glUseProgramObjectARB = SDL_GL_GetProcAddress("glUseProgramObjectARB");
if (ctx->glGetError &&
ctx->glAttachObjectARB &&
ctx->glCompileShaderARB &&
@@ -198,14 +198,14 @@ static int GLES_LoadFunctions(GLES_RenderData * data)
#else
#define SDL_PROC(ret,func,params) \
do { \
data->func = SDL_GL_GetProcAddress(#func); \
*(void**)&data->func = SDL_GL_GetProcAddress(#func); \
if ( ! data->func ) { \
return SDL_SetError("Couldn't load GLES function %s: %s", #func, SDL_GetError()); \
} \
} while ( 0 );
#define SDL_PROC_OES(ret,func,params) \
do { \
data->func = SDL_GL_GetProcAddress(#func); \
*(void**)&data->func = SDL_GL_GetProcAddress(#func); \
} while ( 0 );
#endif /* __SDL_NOGETPROCADDR__ */

@@ -22,6 +22,7 @@

#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED

#include "SDL_assert.h"
#include "SDL_hints.h"
#include "SDL_opengles2.h"
#include "../SDL_sysrender.h"
@@ -259,10 +260,8 @@ GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file,

#if 0
#define GL_CheckError(prefix, renderer)
#elif defined(_MSC_VER) || defined(__WATCOMC__)
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __FUNCTION__)
#else
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __PRETTY_FUNCTION__)
#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, SDL_FILE, SDL_LINE, SDL_FUNCTION)
#endif


@@ -295,7 +294,7 @@ static int GLES2_LoadFunctions(GLES2_DriverContext * data)
#else
#define SDL_PROC(ret,func,params) \
do { \
data->func = SDL_GL_GetProcAddress(#func); \
*(void **)&data->func = SDL_GL_GetProcAddress(#func); \
if ( ! data->func ) { \
return SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \
} \
@@ -91,11 +91,7 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
#if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)
if (!checked_setname) {
void *fn = dlsym(RTLD_DEFAULT, "pthread_setname_np");
#if defined(__MACOSX__) || defined(__IPHONEOS__)
ppthread_setname_np = (int(*)(const char*)) fn;
#elif defined(__LINUX__)
ppthread_setname_np = (int(*)(pthread_t, const char*)) fn;
#endif
*(void **)&ppthread_setname_np = fn;
checked_setname = SDL_TRUE;
}
#endif
@@ -178,7 +178,7 @@ SDL_SYS_SetupThread(const char *name)
if (!kernel32) {
kernel32 = LoadLibraryW(L"kernel32.dll");
if (kernel32) {
pSetThreadDescription = (pfnSetThreadDescription) GetProcAddress(kernel32, "SetThreadDescription");
*(void**)&pSetThreadDescription = GetProcAddress(kernel32, "SetThreadDescription");
}
}

@@ -82,7 +82,7 @@ SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect,
info->dst_pitch = dst->pitch;
info->dst_skip =
info->dst_pitch - info->dst_w * info->dst_fmt->BytesPerPixel;
RunBlit = (SDL_BlitFunc) src->map->data;
*(void**)&RunBlit = src->map->data;

/* Run the actual software blit */
RunBlit(info);
@@ -282,7 +282,7 @@ SDL_CalculateBlit(SDL_Surface * surface)
blit = SDL_Blit_Slow;
}
}
map->data = blit;
*(SDL_BlitFunc *)&map->data = blit;

/* Make sure we have a blit function */
if (blit == NULL) {
@@ -87,7 +87,7 @@ static const char g_rpi_opt_path[] = "/opt/vc/lib";
_this->egl_data->NAME = (void *)NAME;
#else
#define LOAD_FUNC(NAME) \
_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
*(void**)&_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->dll_handle, #NAME); \
if (!_this->egl_data->NAME) \
{ \
return SDL_SetError("Could not retrieve EGL function " #NAME); \
@@ -432,7 +432,7 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa
_this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplay(platform, (void *)(size_t)native_display, NULL);
} else {
if (SDL_EGL_HasExtension(_this, SDL_EGL_CLIENT_EXTENSION, "EGL_EXT_platform_base")) {
_this->egl_data->eglGetPlatformDisplayEXT = SDL_EGL_GetProcAddress(_this, "eglGetPlatformDisplayEXT");
*(void**)&_this->egl_data->eglGetPlatformDisplayEXT = SDL_EGL_GetProcAddress(_this, "eglGetPlatformDisplayEXT");
if (_this->egl_data->eglGetPlatformDisplayEXT) {
_this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplayEXT(platform, (void *)(size_t)native_display, NULL);
}
@@ -365,8 +365,8 @@ struct SDL_VideoDevice
/* Data used by the Vulkan drivers */
struct
{
void *vkGetInstanceProcAddr;
void *vkEnumerateInstanceExtensionProperties;
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
int loader_loaded;
char loader_path[256];
void *loader_handle;

0 comments on commit 90e72bf

Please sign in to comment.