2020-09-08 18:53:54 -05:00
|
|
|
#ifndef STORM_ERROR_HPP
|
|
|
|
|
#define STORM_ERROR_HPP
|
|
|
|
|
|
2025-09-08 22:03:24 -05:00
|
|
|
#include "storm/error/Macros.hpp"
|
|
|
|
|
#include "storm/error/Types.hpp"
|
2025-10-05 20:27:01 -07:00
|
|
|
#include "Core.hpp"
|
2020-09-08 18:53:54 -05:00
|
|
|
|
2020-12-02 20:04:02 -06:00
|
|
|
#if defined(WHOA_SYSTEM_WIN)
|
2023-01-27 11:25:57 -05:00
|
|
|
#include <WinError.h>
|
2020-11-30 23:54:53 -06:00
|
|
|
#endif
|
|
|
|
|
|
2020-12-02 20:04:02 -06:00
|
|
|
#if defined(WHOA_SYSTEM_MAC) || defined(WHOA_SYSTEM_LINUX)
|
2023-01-27 11:25:57 -05:00
|
|
|
#define ERROR_SUCCESS 0x0
|
2025-01-11 11:19:27 -08:00
|
|
|
#define ERROR_INVALID_HANDLE 0x6
|
|
|
|
|
#define ERROR_NOT_ENOUGH_MEMORY 0x8
|
2020-11-21 20:42:18 -06:00
|
|
|
#define ERROR_INVALID_PARAMETER 0x57
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-10-05 20:27:01 -07:00
|
|
|
[[noreturn]] void STORMCDECL SErrDisplayAppFatal(const char* format, ...);
|
2020-09-08 18:53:54 -05:00
|
|
|
|
2025-10-05 20:27:01 -07:00
|
|
|
int32_t STORMAPI SErrDisplayError(uint32_t errorcode, const char* filename, int32_t linenumber, const char* description, int32_t recoverable, uint32_t exitcode, uint32_t a7);
|
2020-09-08 18:53:54 -05:00
|
|
|
|
2025-10-05 20:27:01 -07:00
|
|
|
int32_t STORMCDECL SErrDisplayErrorFmt(uint32_t errorcode, const char* filename, int32_t linenumber, int32_t recoverable, uint32_t exitcode, const char* format, ...);
|
2020-12-08 23:37:22 -06:00
|
|
|
|
2025-10-05 20:27:01 -07:00
|
|
|
void STORMAPI SErrPrepareAppFatal(const char* filename, int32_t linenumber);
|
2020-09-08 18:53:54 -05:00
|
|
|
|
2025-10-05 20:27:01 -07:00
|
|
|
void STORMAPI SErrSetLastError(uint32_t errorcode);
|
2020-09-08 18:53:54 -05:00
|
|
|
|
2025-10-05 20:27:01 -07:00
|
|
|
uint32_t STORMAPI SErrGetLastError();
|
2023-01-27 11:25:57 -05:00
|
|
|
|
2025-10-05 20:27:01 -07:00
|
|
|
void STORMAPI SErrSuppressErrors(uint32_t suppress);
|
2025-08-28 23:03:12 -04:00
|
|
|
|
2020-09-08 18:53:54 -05:00
|
|
|
#endif
|