From 43f088652419e08b7426b2c689591b280c0f2330 Mon Sep 17 00:00:00 2001 From: ken Date: Mon, 16 Jan 2017 16:22:49 -0800 Subject: [PATCH] general debug printing --- src/print.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/print.h diff --git a/src/print.h b/src/print.h new file mode 100644 index 0000000..73df046 --- /dev/null +++ b/src/print.h @@ -0,0 +1,33 @@ +/*!@file + \brief Macros for printing unicode to streams + \details Standardized method of handling unicodes in warnings, and errors + \author Jordan Lavatai + \date Aug 2016 + ----------------------------------------------------------------------------*/ +/* u8 print macros */ +#ifndef _PRINT_H_ +#define _PRINT_H_ +#include +#ifndef DEBUG +#define DEBUG 0 +#endif +#define do_warn(...) do { \ + } while (0) +#define wprintf(...) do { \ + ulc_fprintf(stderr, __VA_ARGS__); \ + do_warn(__VA_ARGS__); \ + } while (0) +#define do_error(...) do { \ + } while (0) +#define eprintf(...) do { \ + ulc_fprintf(stderr, __VA_ARGS__); \ + do_error(__VA_ARGS_); \ + } while (0) +#define bprintf(_BOOL,...) do { \ + if (_BOOL) \ + ulc_fprintf(stdout, __VA_ARGS__); \ + } while (0) +#define dprintf(...) do { \ + bprintf(DEBUG, __VA_ARGS__); \ + } while (0) +#endif -- 2.18.0