Cleanup doxygen

This commit is contained in:
Henrik Stickann
2023-01-31 21:14:02 +01:00
parent a7466d6417
commit 4204c028a2
24 changed files with 89 additions and 154 deletions

View File

@@ -1,6 +1,11 @@
/**
* @file
* @brief Assertion handling.
*
* Configuration:
* * STA_ASSERT_FORCE: Ignore debug defines and always enable assertions
* * DEBUG: Enables assertions when defined
* * NDEBUG: Disables assertions when defined (overrides DEBUG)
*/
#ifndef STA_CORE_ASSERT_HPP
#define STA_CORE_ASSERT_HPP
@@ -22,52 +27,24 @@
* @brief Assertion handling.
*/
#ifdef DOXYGEN
/**
* @def STA_ASSERT_ENABLE
* @brief Enable module.
*
* Automatically defined if DEBUG is defined.
* Automatically disabled if NDEBUG is defined.
*
* @ingroup staCoreBuildConfig
*/
# define STA_ASSERT_ENABLE
/**
* @def STA_ASSERT_DISABLE
* @brief Force disable module.
*
* Overrides STA_ASSERT_ENABLE option.
*
* @ingroup staCoreBuildConfig
*/
# define STA_ASSERT_DISABLE
#endif // DOXYGEN
#include <sta/config.hpp>
#ifdef DEBUG
# ifndef STA_ASSERT_ENABLE
# define STA_ASSERT_ENABLE
# endif // !STA_ASSERT_ENABLE
#endif // DEBUG
#if defined(NDEBUG) || defined(STA_ASSERT_DISABLE)
# ifdef STA_ASSERT_ENABLE
# undef STA_ASSERT_ENABLE
# endif // STA_ASSERT_ENABLE
#endif // NDEBUG || STA_ASSERT_DISABLE
// Determine if module should be enabled
// Condition:
// STA_ASSERT_FORCE is defined
// or
// DEBUG is defined but not NDEBUG
#ifdef STA_ASSERT_FORCE
# define STA_ASSERT_ENABLED
#else // !STA_ASSERT_FORCE
# if defined(DEBUG) && !defined(NDEBUG)
# define STA_ASSERT_ENABLED
# endif // DEBUG && !NDEBUG
#endif // !STA_ASSERT_FORCE
// Show enabled module in doxygen output
#ifdef DOXYGEN
# define STA_ASSERT_ENABLE
#endif // DOXYGEN
#ifdef STA_ASSERT_ENABLE
#if defined(STA_ASSERT_ENABLED) || defined(DOXYGEN)
#include <cstdint>
@@ -152,7 +129,7 @@ namespace sta
# define STA_ASSERT_EXTRA(expr) expr;
#else // !STA_ASSERT_ENABLE
#else // !STA_ASSERT_ENABLED
# define STA_ASSERT(expr) ((void)0)
# define STA_ASSERT_MSG(expr, msg) ((void)0)
@@ -161,7 +138,7 @@ namespace sta
# define STA_ASSERT_EXTRA(expr) ((void)0)
#endif // !STA_ASSERT_ENABLE
#endif // !STA_ASSERT_ENABLED
#endif // STA_CORE_ASSERT_HPP