SlugOS: packages - deprecate ctrlproxy, depends on unstaged tbd.h (samba)
[openembedded.git] / recipes / ixp4xx / ixp-osal-2.1 / assert.patch
1 # Unnecessary patch - reduces the code size slightly, gives clearer
2 # messages if IX_OSAL_ENSURE_ON is set
3 # include/IxOsalAssert.h                 |    4 ++--
4 # os/linux/include/core/IxOsalOsAssert.h |    9 ++++++++-
5 # 2 files changed, 10 insertions(+), 3 deletions(-)
6 #
7 --- ixp_osal/include/IxOsalAssert.h     1970-01-01 00:00:00.000000000 +0000
8 +++ ixp_osal/include/IxOsalAssert.h     1970-01-01 00:00:00.000000000 +0000
9 @@ -72,8 +72,8 @@
10   */
11  #ifdef IX_OSAL_ENSURE_ON
12  #define IX_OSAL_ENSURE(c, str) do { \
13 -if (!(c)) ixOsalLog (IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, str, \
14 -0, 0, 0, 0, 0, 0); } while (0)
15 +if (!(c)) ixOsalLog (IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, __FILE__ ": line %d: " str, \
16 +__LINE__, 0, 0, 0, 0, 0); } while (0)
17  
18  #else
19  #define IX_OSAL_ENSURE(c, str)
20 --- ixp_osal/os/linux/include/core/IxOsalOsAssert.h     1970-01-01 00:00:00.000000000 +0000
21 +++ ixp_osal/os/linux/include/core/IxOsalOsAssert.h     1970-01-01 00:00:00.000000000 +0000
22 @@ -47,11 +47,18 @@
23  
24  #ifndef IxOsalOsAssert_H
25  #define IxOsalOsAssert_H
26 +#ifdef IX_OSAL_ENSURE_ON
27  #define IX_OSAL_OS_ASSERT(c)    if(!(c)) \
28                                  { \
29 -                                    ixOsalLog (IX_OSAL_LOG_LVL_ERROR, IX_OSAL_LOG_DEV_STDOUT, "Assertion failure \n", 0, 0, 0, 0, 0, 0);\
30 +                                    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);\
31                                      BUG(); \
32                                  }
33 +#else
34 +#define IX_OSAL_OS_ASSERT(c)    if(!(c)) \
35 +                                { \
36 +                                    BUG(); \
37 +                                }
38 +#endif
39  
40  /* 
41   * Place holder.