+/* Enable low-level debugging output, if not zero. Defaults to enabled
+ * if QSHOW_SIGNALS, disabled otherwise. Change it to 1 if you want
+ * low-level debugging output but not the whole signal mess. */
+#define QSHOW QSHOW_SIGNALS
+
+#if QSHOW
+
+#if QSHOW_SIGNAL_SAFE
+
+#include <signal.h>
+extern sigset_t blockable_sigset;
+
+#define QSHOW_BLOCK \
+ sigset_t oldset; \
+ thread_sigmask(SIG_BLOCK, &blockable_sigset, &oldset);
+#define QSHOW_UNBLOCK thread_sigmask(SIG_SETMASK,&oldset,0);
+#else
+#define QSHOW_BLOCK
+#define QSHOW_UNBLOCK
+#endif
+
+#ifdef LISP_FEATURE_SB_THREAD
+#define QSHOW_PREFIX fprintf(stderr, "%lu ", pthread_self());
+#else
+#define QSHOW_PREFIX
+#endif
+
+#define FSHOW(args) \
+ do { \
+ QSHOW_BLOCK \
+ QSHOW_PREFIX \
+ fprintf args; \
+ QSHOW_UNBLOCK \
+ } while (0)
+#define SHOW(string) FSHOW((stderr, "/%s\n", string))
+
+#else
+
+#define FSHOW(args)
+#define SHOW(string)
+
+#endif