mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-25 08:44:13 +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:
@@ -32,8 +32,7 @@
|
||||
#include "../../video/uikit/SDL_uikitvideo.h"
|
||||
#endif
|
||||
|
||||
void *
|
||||
SDL_LoadObject(const char *sofile)
|
||||
void *SDL_LoadObject(const char *sofile)
|
||||
{
|
||||
void *handle;
|
||||
const char *loaderror;
|
||||
@@ -53,8 +52,7 @@ SDL_LoadObject(const char *sofile)
|
||||
return handle;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
SDL_FunctionPointer SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
void *symbol = dlsym(handle, name);
|
||||
if (symbol == NULL) {
|
||||
|
||||
@@ -25,16 +25,14 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* System dependent library loading routines */
|
||||
|
||||
void *
|
||||
SDL_LoadObject(const char *sofile)
|
||||
void *SDL_LoadObject(const char *sofile)
|
||||
{
|
||||
const char *loaderror = "SDL_LoadObject() not implemented";
|
||||
SDL_SetError("Failed loading %s: %s", sofile, loaderror);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
SDL_FunctionPointer SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
const char *loaderror = "SDL_LoadFunction() not implemented";
|
||||
SDL_SetError("Failed loading %s: %s", name, loaderror);
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
|
||||
void *
|
||||
SDL_LoadObject(const char *sofile)
|
||||
void *SDL_LoadObject(const char *sofile)
|
||||
{
|
||||
void *handle;
|
||||
LPTSTR tstr;
|
||||
@@ -59,8 +58,7 @@ SDL_LoadObject(const char *sofile)
|
||||
return handle;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
SDL_FunctionPointer SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
void *symbol = (void *)GetProcAddress((HMODULE)handle, name);
|
||||
if (symbol == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user