diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-03-11 09:52:23 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-03-11 09:57:05 +0100 |
commit | 820c23d3973f222ea31f19d4ba026f167a2167c3 (patch) | |
tree | d621040fe8d2ee4e4e80da9454685e2cc9cfdc7c /sal | |
parent | df6097ab4fc7008997caa93fb6674b1e2599e227 (diff) |
sal_Bool to bool in SAL_LOG if possible
otherwise clang warns about things like 1 && 1
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/sal/detail/log.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sal/inc/sal/detail/log.h b/sal/inc/sal/detail/log.h index ce9ac934e151..6ed6a1d95cb8 100644 --- a/sal/inc/sal/detail/log.h +++ b/sal/inc/sal/detail/log.h @@ -58,6 +58,18 @@ extern "C" { #endif +/* + Clang warns about 'sal_True && sal_True' (those being integers and not booleans) + when it sees preprocessed source (-save-temps or using icecream) +*/ +#if defined __cplusplus +#define SAL_LOG_TRUE true +#define SAL_LOG_FALSE false +#else +#define SAL_LOG_TRUE sal_True +#define SAL_LOG_FALSE sal_False +#endif + enum sal_detail_LogLevel { SAL_DETAIL_LOG_LEVEL_INFO, SAL_DETAIL_LOG_LEVEL_WARN, SAL_DETAIL_MAKE_FIXED_SIZE = SAL_MAX_ENUM @@ -81,17 +93,17 @@ SAL_DLLPUBLIC void SAL_CALL sal_detail_logFormat( if (condition) { \ sal_detail_logFormat((level), (area), (where), __VA_ARGS__); \ } \ - } while (sal_False) + } while (SAL_LOG_FALSE) #if defined SAL_LOG_INFO -#define SAL_DETAIL_ENABLE_LOG_INFO sal_True +#define SAL_DETAIL_ENABLE_LOG_INFO SAL_LOG_TRUE #else -#define SAL_DETAIL_ENABLE_LOG_INFO sal_False +#define SAL_DETAIL_ENABLE_LOG_INFO SAL_LOG_FALSE #endif #if defined SAL_LOG_WARN -#define SAL_DETAIL_ENABLE_LOG_WARN sal_True +#define SAL_DETAIL_ENABLE_LOG_WARN SAL_LOG_TRUE #else -#define SAL_DETAIL_ENABLE_LOG_WARN sal_False +#define SAL_DETAIL_ENABLE_LOG_WARN SAL_LOG_FALSE #endif #define SAL_DETAIL_WHERE __FILE__ ":" SAL_STRINGIFY(__LINE__) ": " |