summaryrefslogtreecommitdiff
path: root/packages/ixp4xx/ixp-osal-2.1/assert.patch
blob: 1dfc84ed1210a8a762915995ecf3225b4afbd842 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Unnecessary patch - reduces the code size slightly, gives clearer
# messages if IX_OSAL_ENSURE_ON is set
--- ixp_osal/include/IxOsalAssert.h	2005-11-20 15:19:59.128189352 -0800
+++ ixp_osal/include/IxOsalAssert.h	2005-11-20 15:20:46.099145048 -0800
@@ -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	2005-09-24 20:57:00.000000000 -0700
+++ ixp_osal/os/linux/include/core/IxOsalOsAssert.h	2005-11-20 15:25:32.273152843 -0800
@@ -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.