|
From: Klaus R. <kla...@rz...> - 2007-02-09 10:46:09
|
> A solution could be adding a second argument containing
> a message, but using a macro for user input checking
> seems more appropriate.
How about:
Index: error.c
===================================================================
RCS file: /cvsroot/ming/ming/src/blocks/error.c,v
retrieving revision 1.11
diff -u -r1.11 error.c
--- error.c 8 Jul 2006 13:10:55 -0000 1.11
+++ error.c 9 Feb 2007 10:44:30 -0000
@@ -89,12 +89,7 @@
-void
-SWF_assert(int c)
-{
- if ( !c )
- SWF_error("failed assertion");
-}
+
/*
Index: error.h
===================================================================
RCS file: /cvsroot/ming/ming/src/blocks/error.h,v
retrieving revision 1.7
diff -u -r1.7 error.h
--- error.h 8 Jul 2006 13:10:55 -0000 1.7
+++ error.h 9 Feb 2007 10:44:30 -0000
@@ -23,6 +23,8 @@
SWFMsgFunc setSWFWarnFunction(SWFMsgFunc warn);
SWFMsgFunc setSWFErrorFunction(SWFMsgFunc error);
-void SWF_assert(int c);
+#define SWF_assert(__condition)
\
+ if ( !(__condition) )
\
+ SWF_error("failed assertion in %s:%i\n", __FILE__,__LINE__);
\
#endif /* SWF_ERROR_H_INCLUDED */
|