Update of /cvsroot/mockpp/mockpp/mockpp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7837/mockpp
Modified Files:
Throwable.h mockpp.h
Log Message:
optionally disable exceptions
Index: mockpp.h
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/mockpp.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- mockpp.h 27 Nov 2005 15:34:36 -0000 1.61
+++ mockpp.h 27 Nov 2005 17:27:56 -0000 1.62
@@ -198,6 +198,33 @@
//////////////////////////////////////////////////
//
+#ifndef MOCKPP_NO_EXCEPTIONS
+
+#define MOCKPP_THROW(x) throw (x)
+#define MOCKPP_TRY try
+#define MOCKPP_CATCH(x) (x)
+
+#else
+
+#define CPPUNIT_DISABLE_EXCEPTIONS // ea-hack
+
+# ifndef MOCKPP_THROW
+# define MOCKPP_THROW(x) /**/
+# endif
+
+# ifndef MOCKPP_TRY
+# define MOCKPP_TRY /**/
+# endif
+
+# ifndef MOCKPP_CATCH
+# define MOCKPP_CATCH(x) if(false)
+# endif
+
+#endif
+
+//////////////////////////////////////////////////
+//
+
#ifdef HAVE_LIMITS
# include <limits> // current
#else
Index: Throwable.h
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/Throwable.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Throwable.h 13 Nov 2005 11:53:18 -0000 1.15
+++ Throwable.h 27 Nov 2005 17:27:56 -0000 1.16
@@ -76,7 +76,7 @@
virtual void throw_me()
{
++thrown;
- throw obj;
+ MOCKPP_THROW(obj);
}
|