-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDebug.h
More file actions
24 lines (20 loc) · 766 Bytes
/
Debug.h
File metadata and controls
24 lines (20 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef DEBUG_H
#define DEBUG_H
#include <stdio.h>
/**
* @brief Global debug flag.
* Set to true to enable debug output to stdout.
*/
extern bool gIsDebug;
/**
* @brief Debug logging macro.
* Prints formatted output to stdout if gIsDebug is true.
* Usage: DEBUG_PRINT("Value: %d\n", value);
*/
#define DEBUG_PRINT(...) \
do { \
if (gIsDebug) { \
printf(__VA_ARGS__); \
} \
} while (0)
#endif // DEBUG_H