summaryrefslogtreecommitdiff
path: root/lib/nes/common/debug.hh
blob: a7a0854df12ff498958fbb03acd244971461602f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#ifdef NES_ENABLE_DEBUG_OUTPUT

#include <spdlog/spdlog.h>

#define NES_DEBUG_LOG(name, ...) \
	spdlog::info("[" #name "] " __VA_ARGS__)

#else

#define NES_DEBUG_LOG(name, fmt, ...) \
	(void)0

#endif

#ifdef NDEBUG

#define NES_ASSERT(...) \
	(void)0

#else

#ifdef NES_HAS_STDLIB
#include <cassert>
#else
#include "debug/assert.h"
#endif

#define NES_ASSERT(...) \
	assert(__VA_ARGS__)

#endif