#ifndef PLATFORMS_HOSTED_DEBUG_H
#define PLATFORMS_HOSTED_DEBUG_H
#if !defined(__USE_MINGW_ANSI_STDIO)
#define __USE_MINGW_ANSI_STDIO 1
#endif
#include <stdint.h>
#include <stdio.h>
typedef const char *debug_str_t;
#if defined(_WIN32) || defined(__CYGWIN__)
#define DEBUG_FORMAT_ATTR __attribute__((format(__MINGW_PRINTF_FORMAT, 1, 2)))
#else
#define DEBUG_FORMAT_ATTR __attribute__((format(printf, 1, 2)))
#endif
#define BMD_DEBUG_ERROR (1U << 0U)
#define BMD_DEBUG_WARNING (1U << 1U)
#define BMD_DEBUG_INFO (1U << 2U)
#define BMD_DEBUG_GDB (1U << 3U)
#define BMD_DEBUG_TARGET (1U << 4U)
#define BMD_DEBUG_PROTO (1U << 5U)
#define BMD_DEBUG_PROBE (1U << 6U)
#define BMD_DEBUG_WIRE (1U << 7U)
#define BMD_DEBUG_USE_STDERR (1U << 15U)
#define BMD_DEBUG_LEVEL_MASK 0x00fcU
#define BMD_DEBUG_LEVEL_SHIFT 2U
extern uint16_t bmda_debug_flags;
void debug_error(const char *format, ...) DEBUG_FORMAT_ATTR;
void debug_warning(const char *format, ...) DEBUG_FORMAT_ATTR;
void debug_info(const char *format, ...) DEBUG_FORMAT_ATTR;
void debug_gdb(const char *format, ...) DEBUG_FORMAT_ATTR;
void debug_target(const char *format, ...) DEBUG_FORMAT_ATTR;
void debug_protocol(const char *format, ...) DEBUG_FORMAT_ATTR;
void debug_probe(const char *format, ...) DEBUG_FORMAT_ATTR;
void debug_wire(const char *format, ...) DEBUG_FORMAT_ATTR;
#endif