Skip to content

Commit 364a61b

Browse files
committed
make debug MACRO (more) unique
1 parent 0f778ee commit 364a61b

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/AppleMIDI_Debug.h

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
1+
#pragma once
2+
3+
#include "AppleMIDI_Namespace.h"
4+
BEGIN_APPLEMIDI_NAMESPACE
5+
16
#ifdef APPLEMIDI_DEBUG
27
namespace {
3-
static void DBG_SETUP(unsigned long baud) {
8+
static void AM_DBG_SETUP(unsigned long baud) {
49
APPLEMIDI_DEBUG.begin(baud);
510
while (!APPLEMIDI_DEBUG);
611
}
712

813
template <typename T>
9-
static void DBG_PLAIN(T last) {
14+
static void AM_DBG_PLAIN(T last) {
1015
APPLEMIDI_DEBUG.println(last);
1116
}
1217

1318
template <typename T, typename... Args>
14-
static void DBG_PLAIN(T head, Args... tail) {
19+
static void AM_DBG_PLAIN(T head, Args... tail) {
1520
APPLEMIDI_DEBUG.print(head);
1621
APPLEMIDI_DEBUG.print(' ');
17-
DBG_PLAIN(tail...);
22+
AM_DBG_PLAIN(tail...);
1823
}
1924

2025
template <typename... Args>
21-
static void DBG(Args... args) {
22-
DBG_PLAIN(args...);
26+
static void AM_DBG(Args... args) {
27+
AM_DBG_PLAIN(args...);
2328
}
2429
} // namespace
2530
#else
26-
#define DBG_SETUP(...)
27-
#define DBG_PLAIN(...)
28-
#define DBG(...)
29-
#endif
31+
#define AM_DBG_SETUP(...)
32+
#define AM_DBG_PLAIN(...)
33+
#define AM_DBG(...)
34+
#endif
35+
36+
END_APPLEMIDI_NAMESPACE

0 commit comments

Comments
 (0)