embkernel
 All Classes Functions Variables Typedefs Groups Pages
LibMacros.hpp
1 //------------------------------------------------------------------------------
2 //This file is part of embKernel.
3 //See license.txt for the full license governing this code.
4 //------------------------------------------------------------------------------
5 
6 #ifndef LIB_MACROS_HPP_
7 #define LIB_MACROS_HPP_
8 
9 #include "LibCfg.hpp"
10 #include "LibLog.hpp"
11 
12 #define ALIGN_TO_SIZE(value, size) (((value) + size - 1) & ~(size-1))
13 
14 #if LIB_CFG_DEBUG_ENABLE
15 #define LIB_DEBUG(level, string, ...) LibLog::printf(level,"%s/%d/" string "\r\n", __PRETTY_FUNCTION__,__LINE__, ##__VA_ARGS__)
16 #define LIB_ASSERT(condition) if((condition) == false){__error__(__FILE__, __LINE__);};
17 #else
18 #define LIB_DEBUG(level, string, ...)
19 #define LIB_ASSERT(condition);
20 #endif
21 extern void __error__(const char *fileName, unsigned long line);
22 
23 #endif /* LIB_MACROS_HPP_ */
24