chuniio-brokenithm/util/dprintf.h

31 lines
536 B
C
Raw Permalink Normal View History

2023-12-30 05:02:40 +00:00
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include <stddef.h>
#ifdef __GNUC__
2023-12-31 07:37:45 +00:00
#define DPRINTF_CHK __attribute__((format(printf, 1, 2)))
2023-12-30 05:02:40 +00:00
#else
#define DPRINTF_CHK
#endif
#ifndef NDEBUG
void dprintf(const char *fmt, ...) DPRINTF_CHK;
void dprintfv(const char *fmt, va_list ap);
void dwprintf(const wchar_t *fmt, ...);
void dwprintfv(const wchar_t *fmt, va_list ap);
#else
#define dprintf(...)
#define dprintfv(fmt, ap)
#define dwprintf(...)
#define dwprintfv(fmt, ap)
#endif
#ifdef __cplusplus
}
#endif