From 6f3ec4aa23606af60c4abb602bc2a87353a87e61 Mon Sep 17 00:00:00 2001 From: "graehl@gmail.com" Date: Sun, 15 Aug 2010 08:50:14 +0000 Subject: files required for test git-svn-id: https://ws10smt.googlecode.com/svn/trunk@556 ec762483-ff6d-05da-a07a-a48fb63a330f --- utils/show.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 utils/show.h (limited to 'utils') diff --git a/utils/show.h b/utils/show.h new file mode 100755 index 00000000..e8adff99 --- /dev/null +++ b/utils/show.h @@ -0,0 +1,41 @@ +#ifndef UTILS__SHOW_H +#define UTILS__SHOW_H + +#ifndef SHOWS +#include +#endif +/* usage: +#if DEBUG +# define IFD(x) x +#else +# define IFD(x) +#endif + +SHOWS(IFD,x) SHOWS(IFD,y) SHOW(IFD,nl_after) + +will print x=X y=Y nl_after=NL_AFTER\n if DEBUG. + +SHOW3(IFD,x,y,nl_after) is short for the same + +SHOWP("a") will just print "a" + +careful: none of this is wrapped in a block. so you can't use one of these macros as a single-line block. + + */ + +#ifndef SHOWS +#define SHOWS std::cerr +#endif + +#define SHOWP(IF,x) IF(SHOWS<