mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-12-16 16:48:04 +00:00
Fix indentation. Update doxygen comments
This commit is contained in:
@@ -11,20 +11,14 @@
|
||||
#define STA_CORE_ASSERT_HPP
|
||||
|
||||
/**
|
||||
* @defgroup staCore Core
|
||||
* @defgroup sta_core Core
|
||||
* @brief STA Core library
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup staCoreBuildConfig Build Config
|
||||
* @ingroup staCore
|
||||
* @brief Build configuration options
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup staCoreAssert Assert
|
||||
* @ingroup staCore
|
||||
* @brief Assertion handling.
|
||||
* @defgroup sta_core_platforms Platforms
|
||||
* @ingroup sta_core
|
||||
* @brief Platform specific implementations.
|
||||
*/
|
||||
|
||||
|
||||
@@ -49,8 +43,21 @@
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup sta_core_assert Assert
|
||||
* @ingroup sta_core
|
||||
* @brief Assertion handling.
|
||||
*/
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
/**
|
||||
* @ingroup sta_core_assert
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Handle failed assertions.
|
||||
*
|
||||
@@ -62,8 +69,6 @@ namespace sta
|
||||
* @param expr Asserted expression or message
|
||||
* @param file File name
|
||||
* @param line Line number
|
||||
*
|
||||
* @ingroup staCoreAssert
|
||||
*/
|
||||
void assert_failed(const char * expr, const char * file, uint32_t line);
|
||||
|
||||
@@ -71,48 +76,38 @@ namespace sta
|
||||
* @brief Stop execution.
|
||||
*
|
||||
* Weak implementation can be overridden.
|
||||
*
|
||||
* @ingroup staCoreAssert
|
||||
*/
|
||||
void assert_halt();
|
||||
|
||||
|
||||
/** @} */
|
||||
} // namespace sta
|
||||
|
||||
|
||||
/**
|
||||
* @def STA_HALT
|
||||
* @brief Set function called after failed asserts.
|
||||
*
|
||||
* @ingroup staCoreBuildConfig
|
||||
* @ingroup sta_core_assert
|
||||
* @{
|
||||
*/
|
||||
# ifndef STA_HALT
|
||||
# define STA_HALT() sta::assert_halt()
|
||||
# endif // !STA_HALT
|
||||
|
||||
|
||||
/**
|
||||
* @brief Assert expression.
|
||||
*
|
||||
* @param expr Expression
|
||||
*
|
||||
* @ingroup staCoreAssert
|
||||
*/
|
||||
# define STA_ASSERT(expr) ( (void)( !(expr) && ( sta::assert_failed(#expr, __FILE__, __LINE__), 1 ) && ( STA_HALT(), 1 ) ) )
|
||||
# define STA_ASSERT(expr) ( (void)( !(expr) && ( sta::assert_failed(#expr, __FILE__, __LINE__), 1 ) && ( sta::assert_halt(), 1 ) ) )
|
||||
/**
|
||||
* @brief Assert expression.
|
||||
*
|
||||
* @param expr Expression
|
||||
* @param msg Message shown on failure
|
||||
*
|
||||
* @ingroup staCoreAssert
|
||||
*/
|
||||
# define STA_ASSERT_MSG(expr, msg) ( (void)( !(expr) && ( sta::assert_failed(msg, __FILE__, __LINE__), 1 ) && ( STA_HALT(), 1 ) ) )
|
||||
# define STA_ASSERT_MSG(expr, msg) ( (void)( !(expr) && ( sta::assert_failed(msg, __FILE__, __LINE__), 1 ) && ( sta::assert_halt(), 1 ) ) )
|
||||
/**
|
||||
* @brief Assert expression if condition is true.
|
||||
*
|
||||
* @param cond Condition
|
||||
* @param expr Expression
|
||||
*
|
||||
* @ingroup staCoreAssert
|
||||
*/
|
||||
# define STA_ASSERT_COND(cond, expr) ( (void)( (cond) ? STA_ASSERT(expr) : 1 ) )
|
||||
/**
|
||||
@@ -121,13 +116,17 @@ namespace sta
|
||||
* @param cond Condition
|
||||
* @param expr Expression
|
||||
* @param msg Message shown on failure
|
||||
*
|
||||
* @ingroup staCoreAssert
|
||||
*/
|
||||
# define STA_ASSERT_COND_MSG(cond, expr, msg) ( (void)( (cond) ? STA_ASSERT_MSG(expr, msg) ) )
|
||||
/**
|
||||
* @brief Expression only evaluated when assertions are enabled.
|
||||
*
|
||||
* @param expr Expression
|
||||
*/
|
||||
# define STA_ASSERT_EXTRA(expr) expr
|
||||
|
||||
|
||||
# define STA_ASSERT_EXTRA(expr) expr;
|
||||
/** @} */
|
||||
|
||||
#else // !STA_ASSERT_ENABLED
|
||||
|
||||
|
||||
Reference in New Issue
Block a user