Hermes
debug.h File Reference

Debug, logging and assertion macros. More...

Go to the source code of this file.

Macros

#define HERMES_DEBUG
 
#define CHECKS_ENABLED
 
#define ASSERTIONS_ENABLED
 
#define HERMES_UNUSED_VARIABLE(x)   ((void)x);
 Specifies that variable is not used in this scope. More...
 
#define HERMES_NOT_IMPLEMENTED    printf("[%s][%d][%s] calling not implemented function.", __FILE__, __LINE__, __FUNCTION__);
 Logs "calling code not implemented" warning.
 
#define HERMES_DEBUG_CODE(CODE_CONTENT)   {CODE_CONTENT}
 
#define HERMES_CHECK_EQUAL(A, B)
 Warns if values are different. More...
 
#define HERMES_CHECK_EXP(expr)
 Warns if expression is false. More...
 
#define HERMES_CHECK_EXP_WITH_LOG(expr, M)
 Warns if expression is false with message. More...
 
#define debugBreak()   exit(-1)
 
#define HERMES_ASSERT(expr)
 Errors if expression is false. More...
 
#define HERMES_ASSERT_WITH_LOG(expr, M)
 Errors if expression is false with message. More...
 
#define HERMES_RETURN_IF(A)
 Calls return if condition is true. More...
 
#define HERMES_RETURN_IF_NOT(A)
 Calls return if condition is false. More...
 
#define HERMES_RETURN_VALUE_IF(A, R)
 Return value if condition is true. More...
 
#define HERMES_RETURN_VALUE_IF_NOT(A, R)
 Return value if condition is false. More...
 
#define HERMES_LOG_AND_RETURN_VALUE_IF_NOT(A, R, M)
 Logs and return value if condition is false. More...
 
#define HERMES_LOG_AND_RETURN_IF_NOT(A, M)
 Logs and return if condition is false. More...
 

Detailed Description

Debug, logging and assertion macros.

Copyright (c) 2022, FilipeCN.

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
FilipeCN (filip.nosp@m.edec.nosp@m.n@gma.nosp@m.il.c.nosp@m.om)
Date
2017-01-04