#ifndef CORE_ERROR_SIMULATOR_HPP #define CORE_ERROR_SIMULATOR_HPP #include "core/utils/Utility.hpp" #ifdef ERROR_SIMULATOR namespace Core::Fail { extern bool realloc; extern bool fileClose; extern bool timeGet; extern int leftAllocations; inline bool freeAndReturn(void* p) { Core::free(p); return true; } } #define CORE_REALLOC_FAIL(pointer) \ (Core::Fail::realloc && Core::Fail::freeAndReturn(pointer)) #define CORE_FILE_CLOSE_FAIL Core::Fail::fileClose #define CORE_TIME_GET_FAIL Core::Fail::timeGet #else #define CORE_REALLOC_FAIL false #define CORE_FILE_CLOSE_FAIL false #define CORE_TIME_GET_FAIL false #endif #endif