diff --git a/include/SDL_error.h b/include/SDL_error.h index a4a90d0e4..5aa5c9162 100644 --- a/include/SDL_error.h +++ b/include/SDL_error.h @@ -41,7 +41,7 @@ extern "C" { /* Public functions */ extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); -extern DECLSPEC char *SDLCALL SDL_GetError(void); +extern DECLSPEC const char *SDLCALL SDL_GetError(void); extern DECLSPEC void SDLCALL SDL_ClearError(void); /** diff --git a/src/SDL_error.c b/src/SDL_error.c index 99ac09cdc..1f6c8a903 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -198,12 +198,12 @@ SDL_GetErrorMsg(char *errstr, unsigned int maxlen) } /* Available for backwards compatibility */ -char * +const char * SDL_GetError(void) { static char errmsg[SDL_ERRBUFIZE]; - return ((char *) SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE)); + return SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE); } void