Files
RedScarfEngine/utilities/rse_commons.h
T
Piotr Krygier 1f585b4d8e Refactoring
Cleaned up a project, removed uneccessary includes.
Fixed few errors, nothing major.
2025-06-20 13:44:33 +02:00

36 lines
875 B
C

/**
* @file rse_commons.h
* @author Piotr Krygier (everyonecancode@gmail.com)
* @brief Common functionality for all modules
* @version 0.1
* @date 2023-10-05
*
* @copyright Copyright (c) 2023
*
*/
#ifndef RSE_COMMONS_H
#define RSE_COMMONS_H
#include "utilities/locale_common.h"
#include <stdint.h>
/**
* @brief Macro for allocating memory and checking it on the same line
*
*/
#define rse_malloc(ptr, size) \
ptr = malloc(size); \
if (ptr == NULL) { \
LOGF(common_messages[COMMON_ERROR_MEMORY_ALLOCATION_FAILED]); \
return RSE_COMMON_ERROR_MALLLOC_FAILED; \
}
/**
* @brief Error type for RSE
*
*/
typedef uint32_t rse_err_t;
#endif /* RSE_COMMONS_H */