| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | * Simple error message routines for SDL. |
| | | */ |
| | | |
| | | #ifndef _SDL_error_h |
| | | #define _SDL_error_h |
| | | #ifndef SDL_error_h_ |
| | | #define SDL_error_h_ |
| | | |
| | | #include "SDL_stdinc.h" |
| | | |
| | |
| | | |
| | | /* Public functions */ |
| | | /* SDL_SetError() unconditionally returns -1. */ |
| | | extern DECLSPEC int SDLCALL SDL_SetError(const char *fmt, ...); |
| | | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); |
| | | extern DECLSPEC const char *SDLCALL SDL_GetError(void); |
| | | extern DECLSPEC void SDLCALL SDL_ClearError(void); |
| | | |
| | |
| | | * \internal |
| | | * Private error reporting function - used internally. |
| | | */ |
| | | /*@{*/ |
| | | /* @{ */ |
| | | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) |
| | | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) |
| | | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) |
| | |
| | | } SDL_errorcode; |
| | | /* SDL_Error() unconditionally returns -1. */ |
| | | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); |
| | | /*@}*//*Internal error functions*/ |
| | | /* @} *//* Internal error functions */ |
| | | |
| | | /* Ends C function definitions when using C++ */ |
| | | #ifdef __cplusplus |
| | |
| | | #endif |
| | | #include "close_code.h" |
| | | |
| | | #endif /* _SDL_error_h */ |
| | | #endif /* SDL_error_h_ */ |
| | | |
| | | /* vi: set ts=4 sw=4 expandtab: */ |