aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/checkpoint.cpp3
-rw-r--r--src/checkpoint.h6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/checkpoint.cpp b/src/checkpoint.cpp
index 6fcc1a2..a37c1be 100644
--- a/src/checkpoint.cpp
+++ b/src/checkpoint.cpp
@@ -26,7 +26,8 @@
using namespace std;
-void checkpoint(string msg, string filename) {
+void checkpoint_run(string msg, string filename, string srcfilename, int line, string funcname) {
+ is_debug_mode() && std::cerr << "**** DEBUG: checkpoint " << msg << " passed with " << filename << " in " << srcfilename << " at line " << line << " in " << funcname << endl;
if (msg == checkpoint_name) {
cerr << "**** Checkpoint reached: " << msg << " (normal exit)" << endl;
exit(0);
diff --git a/src/checkpoint.h b/src/checkpoint.h
index 7a70855..2792fac 100644
--- a/src/checkpoint.h
+++ b/src/checkpoint.h
@@ -20,12 +20,14 @@
#ifndef __CHECKPOINT_H__
#define __CHECKPOINT_H__
-#include <string>
+#include <debug.h>
using namespace std;
extern string checkpoint_name;
-void checkpoint(string msg, string filename);
+void checkpoint_run(string msg, string filename, string srcfilename, int line, string funcname);
+#define checkpoint(msg, fname) \
+ checkpoint_run(msg, fname, __FILE__, __LINE__, __SHOW_FUNC)
#endif