diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-19 07:06:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-19 07:06:44 +0400 |
commit | d0aa012b0a451f52409a5d4df33dcdcac2763562 (patch) | |
tree | cedc47e839dab989558f64d1fafccd0ac0027026 /source | |
parent | 9d3e755b4c6bfbb0bd43e0c98abc06994e7ca5df (diff) |
change BLI_assert() so it can be included in other defines.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index a6b4f2c9b92..94189af34fa 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -279,24 +279,22 @@ # endif # if defined(__GNUC__) || defined(_MSC_VER) /* check __func__ is available */ # define BLI_assert(a) \ -do { \ - if (!(a)) { \ + (void)((!(a)) ? ( \ + ( \ fprintf(stderr, \ "BLI_assert failed: %s, %s(), %d at \'%s\'\n", \ - __FILE__, __func__, __LINE__, STRINGIFY(a)); \ - _dummy_abort(); \ - } \ -} while (0) + __FILE__, __func__, __LINE__, STRINGIFY(a)), \ + _dummy_abort(), \ + NULL)) : NULL) # else -# define BLI_assert(a) \ -do { \ - if (0 == (a)) { \ +# define BLI_assert(a) \ + (void)((!(a)) ? ( \ + ( \ fprintf(stderr, \ "BLI_assert failed: %s, %d at \'%s\'\n", \ - __FILE__, __LINE__, STRINGIFY(a)); \ - _dummy_abort(); \ - } \ -} while (0) + __FILE__, __LINE__, STRINGIFY(a)), \ + _dummy_abort(), \ + NULL)) : NULL) # endif #else # define BLI_assert(a) (void)0 |