You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-misc/ixp4xx/files/2.1/35-oe-assert.patch

38 lines
1.4 KiB

# Unnecessary patch - reduces the code size slightly, gives clearer
# messages if IX_OSAL_ENSURE_ON is set
--- ixp_osal/include/IxOsalAssert.h
+++ ixp_osal/include/IxOsalAssert.h
@@ -72,8 +72,8 @@
*/
#ifdef IX_OSAL_ENSURE_ON
#define IX_OSAL_ENSURE(c, str) do { \
-if (!(c)) ixOsalLog (IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, str, \
-0, 0, 0, 0, 0, 0); } while (0)
+if (!(c)) ixOsalLog (IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, __FILE__ ": line %d: " str, \
+__LINE__, 0, 0, 0, 0, 0); } while (0)
#else
#define IX_OSAL_ENSURE(c, str)
--- ixp_osal/os/linux/include/core/IxOsalOsAssert.h
+++ ixp_osal/os/linux/include/core/IxOsalOsAssert.h
@@ -47,11 +47,18 @@
#ifndef IxOsalOsAssert_H
#define IxOsalOsAssert_H
+#ifdef IX_OSAL_ENSURE_ON
#define IX_OSAL_OS_ASSERT(c) if(!(c)) \
{ \
- ixOsalLog (IX_OSAL_LOG_LVL_ERROR, IX_OSAL_LOG_DEV_STDOUT, "Assertion failure \n", 0, 0, 0, 0, 0, 0);\
+ ixOsalLog (IX_OSAL_LOG_LVL_ERROR, IX_OSAL_LOG_DEV_STDOUT, "%s line %d: Assertion failure: %s\n", (int)__FILE__, __LINE__, (int)#c, 0, 0, 0);\
BUG(); \
}
+#else
+#define IX_OSAL_OS_ASSERT(c) if(!(c)) \
+ { \
+ BUG(); \
+ }
+#endif
/*
* Place holder.