Import TBBT (NFS trace replay).
[bluesky.git] / TBBT / trace_play / rfs_assert.h
diff --git a/TBBT/trace_play/rfs_assert.h b/TBBT/trace_play/rfs_assert.h
new file mode 100644 (file)
index 0000000..ec360d5
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef RFS_ASSERT_H
+#define RFS_ASSERT_H
+#define RFS_ASSERT(condition)                                       \
+    if (!(condition)) {                                             \
+        fprintf(stderr, "Assertion failed: line %d, file \"%s\"\n", \
+                           __LINE__, __FILE__);                        \
+               fflush(stdout); \
+               fflush(stdout); \
+               fflush(stderr); \
+               fflush(stderr); \
+               exit(-1); \
+    }
+#endif