summaryrefslogtreecommitdiff
path: root/lib/nes/common/debug.hh
blob: 30370e9191f100afabe77a788a95634796d180e6 (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
#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

#include <cassert>

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

#endif