SDL_error.h 876 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _SDL_error_h
  2. #define _SDL_error_h
  3. #include "SDL_stdinc.h"
  4. #include "begin_code.h"
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef int SDLCALL tSDL_SetError(const char *fmt, ...);
  9. typedef const char * SDLCALL tSDL_GetError(void);
  10. typedef void SDLCALL tSDL_ClearError(void);
  11. #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
  12. #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
  13. #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
  14. typedef enum
  15. {
  16. SDL_ENOMEM,
  17. SDL_EFREAD,
  18. SDL_EFWRITE,
  19. SDL_EFSEEK,
  20. SDL_UNSUPPORTED,
  21. SDL_LASTERROR
  22. } SDL_errorcode;
  23. typedef int SDLCALL tSDL_Error(SDL_errorcode code);
  24. extern tSDL_SetError *SDL_SetError;
  25. extern tSDL_GetError *SDL_GetError;
  26. extern tSDL_ClearError *SDL_ClearError;
  27. extern tSDL_Error *SDL_Error;
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #include "close_code.h"
  32. #endif