mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-04 14:49:40 +00:00
Functions which return function pointers now return SDL_FunctionPointer instead of void*
This fixes the clang warning "Cast between pointer-to-function and pointer-to-object is an extension" You can define SDL_FUNCTION_POINTER_IS_VOID_POINTER in your project to restore the previous behavior. Fixes https://github.com/libsdl-org/SDL/issues/2866
This commit is contained in:
@@ -45,7 +45,7 @@ static int LoadContext(GL_Context *data)
|
||||
#else
|
||||
#define SDL_PROC(ret, func, params) \
|
||||
do { \
|
||||
data->func = SDL_GL_GetProcAddress(#func); \
|
||||
data->func = (ret (APIENTRY *) params)SDL_GL_GetProcAddress(#func); \
|
||||
if (!data->func) { \
|
||||
return SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \
|
||||
} \
|
||||
|
||||
@@ -71,7 +71,7 @@ static int LoadContext(GLES2_Context *data)
|
||||
#else
|
||||
#define SDL_PROC(ret, func, params) \
|
||||
do { \
|
||||
data->func = SDL_GL_GetProcAddress(#func); \
|
||||
data->func = (ret (APIENTRY *) params)SDL_GL_GetProcAddress(#func); \
|
||||
if (!data->func) { \
|
||||
return SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \
|
||||
} \
|
||||
|
||||
@@ -73,7 +73,7 @@ static int LoadContext(GLES2_Context *data)
|
||||
#else
|
||||
#define SDL_PROC(ret, func, params) \
|
||||
do { \
|
||||
data->func = SDL_GL_GetProcAddress(#func); \
|
||||
data->func = (ret (APIENTRY *) params)SDL_GL_GetProcAddress(#func); \
|
||||
if (!data->func) { \
|
||||
return SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \
|
||||
} \
|
||||
|
||||
@@ -192,7 +192,7 @@ static void quit(int rc)
|
||||
|
||||
static void loadGlobalFunctions(void)
|
||||
{
|
||||
vkGetInstanceProcAddr = SDL_Vulkan_GetVkGetInstanceProcAddr();
|
||||
vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_Vulkan_GetVkGetInstanceProcAddr();
|
||||
if (!vkGetInstanceProcAddr) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"SDL_Vulkan_GetVkGetInstanceProcAddr(): %s\n",
|
||||
|
||||
Reference in New Issue
Block a user