mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +01:00
WUtil: remove duplicated information from 'wassertr(v)' message
The information about the File, Line and Function name that were included in the assertion message are already present from the 'wwarning' macro, so it is not necessary to include them in the macro's message. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
0350026866
commit
3ab50b65b7
@@ -40,15 +40,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ASSERT_FUNCTION
|
|
||||||
# if (!defined (__GNUC__) || (__GNUC__ < 2 && \
|
|
||||||
__GNUC_MINOR__ < (defined (__cplusplus) ? 6 : 4)))
|
|
||||||
# define __ASSERT_FUNCTION ((char *) 0)
|
|
||||||
# else
|
|
||||||
# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __GNUC__
|
#ifndef __GNUC__
|
||||||
#define __attribute__(x) /*NOTHING*/
|
#define __attribute__(x) /*NOTHING*/
|
||||||
#endif
|
#endif
|
||||||
@@ -65,15 +56,13 @@
|
|||||||
|
|
||||||
#define wassertr(expr) \
|
#define wassertr(expr) \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
wwarning("%s line %i (%s): assertion %s failed",\
|
wwarning("wassertr: assertion %s failed", #expr); \
|
||||||
__FILE__, __LINE__, __ASSERT_FUNCTION, #expr);\
|
|
||||||
return;\
|
return;\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define wassertrv(expr, val) \
|
#define wassertrv(expr, val) \
|
||||||
if (!(expr)) { \
|
if (!(expr)) { \
|
||||||
wwarning("%s line %i (%s): assertion %s failed",\
|
wwarning("wassertrv: assertion %s failed", #expr); \
|
||||||
__FILE__, __LINE__, __ASSERT_FUNCTION, #expr);\
|
|
||||||
return (val);\
|
return (val);\
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user