Use more descriptive error messages for invalid stacks in proc_new()
[bertos.git] / bertos / cfg / debug.h
index 257682933d3fcf7576e79e8f2d68c79ab05e5066..efa26e18907a8102699d3ca125cf099abf43dbf3 100644 (file)
                #define ASSERT2(x, help)  ((void)ASSERT(x))
        #endif
 
+       #define IS_VALID_PTR(p) (LIKELY((void *)(p) >= (void *)CPU_RAM_START))
        /**
         * Check that the given pointer is either NULL or pointing to valid memory.
         *
         *
         * \see ASSERT_VALID_PTR_OR_NULL()
         */
-       #define ASSERT_VALID_PTR(p) ((void)(LIKELY((void *)(p) >= (void *)CPU_RAM_START) \
-               ? 0 : __invalid_ptr(p, #p, THIS_FILE, __LINE__)))
+       #define ASSERT_VALID_PTR(p) (IS_VALID_PTR(p) \
+               ? 0 : __invalid_ptr(p, #p, THIS_FILE, __LINE__))
 
        /**
         * Check that the given pointer is not pointing to invalid memory.
                #define ASSERT(x)  ((void)0)
        #endif /* ASSERT */
        #define ASSERT2(x, help)             ((void)0)
+       #define IS_VALID_PTR(p)              (1)
        #define ASSERT_VALID_PTR(p)          ((void)0)
        #define ASSERT_VALID_PTR_OR_NULL(p)  ((void)0)
        #define ASSERT_VALID_OBJ(_t, _o)     ((void)0)