[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42718] trunk/blender/source/blender/ blenlib/BLI_utildefines.h: change BLI_assert() so it can be included in other defines.

Campbell Barton ideasman42 at gmail.com
Mon Dec 19 04:06:58 CET 2011


Revision: 42718
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42718
Author:   campbellbarton
Date:     2011-12-19 03:06:44 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
change BLI_assert() so it can be included in other defines.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_utildefines.h

Modified: trunk/blender/source/blender/blenlib/BLI_utildefines.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_utildefines.h	2011-12-18 23:32:24 UTC (rev 42717)
+++ trunk/blender/source/blender/blenlib/BLI_utildefines.h	2011-12-19 03:06:44 UTC (rev 42718)
@@ -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




More information about the Bf-blender-cvs mailing list