OSSP CVS Repository

ossp - Check-in [994]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 994
Date: 2001-Sep-13 18:32:12 (local)
2001-Sep-13 16:32:12 (UTC)
User:ms
Branch:
Comment: Added assertion macro for debugging purposes.
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2.h.in      1.6 -> 1.7     13 inserted, 0 deleted

ossp-pkg/l2/l2.h.in 1.6 -> 1.7

--- l2.h.in      2001/09/12 13:50:46     1.6
+++ l2.h.in      2001/09/13 16:32:12     1.7
@@ -64,6 +64,19 @@
 #define TRUE (!FALSE)
 #endif
 
+#ifndef DEBUG
+#define ASSERT(expr) ((voir)0)
+#else
+#define ASSERT(expr)\
+        do {\
+            if (!(expr)) {\
+                fprintf(stderr, "Assertion failed in %s line %d! ", __FILE__, __LINE__);\
+                exit(1);\
+            }\
+        }\
+        while (0)
+#endif
+
 /* forward declarations for opaque data structures */
 union  l2_context_un;
 struct l2_param_st;

CVSTrac 2.0.1