Author: infinoid
Date: Fri Jan 2 21:13:47 2009
New Revision: 34854
Modified:
branches/assert_args/include/parrot/exceptions.h
Log:
[core] Fix PARROT_ASSERT_ARG to emit the correct file and line number.
Modified: branches/assert_args/include/parrot/exceptions.h
==============================================================================
--- branches/assert_args/include/parrot/exceptions.h (original)
+++ branches/assert_args/include/parrot/exceptions.h Fri Jan 2 21:13:47 2009
@@ -279,10 +279,17 @@
* so headerizer can define the ASSERT_ARGS_* macros like:
* int _ASSERT_ARGS = PARROT_ASSERT_ARG(a) || PARROT_ASSERT_ARG(b) || ...
*/
-static inline int PARROT_ASSERT_ARG(const void *x) {
+static inline int
+_PARROT_ASSERT_ARG(const void *x, const char *name,
+ const char *file, unsigned int line) /* HEADERIZER SKIP */
+{
+#ifndef NDEBUG
+ if(!x) Parrot_confess(name, file, line);
+#endif
PARROT_ASSERT(x);
return 0;
}
+#define PARROT_ASSERT_ARG(x) _PARROT_ASSERT_ARG((x), (#x), __FILE__, __LINE__)
#define ASSERT_ARGS(a) ASSERT_ARGS_ ## a