my_teams
debug_print.h
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2024
3 ** my_teams [WSL: Arch]
4 ** File description:
5 ** debug_print
6 */
7 
8 #ifndef DEBUG_PRINT_H_
9  #define DEBUG_PRINT_H_
10 
11 #ifndef _GNU_SOURCE
12  #define _GNU_SOURCE
13 #endif
14 
15 #ifdef DEBUG
16  #warning "Debug mode enabled"
17 
18  #ifndef fprintf
19  #include <stdio.h>
20  #endif
21 
22  #define _D_GREEN_ANSII "\033[032m"
23  #define _D_END_ANSII "\033[0m"
24 
25  #define D_S _D_GREEN_ANSII "[DEBUG] " _D_END_ANSII "%s:%d:%s():"
26  #define D_VA __FILE__, __LINE__, __func__
27 
28  #define DEBUG_PRINT(fmt, ...) fprintf(stdout, D_S fmt, D_VA, ##__VA_ARGS__)
29 #else
30  #define DEBUG_PRINT(fmt, ...)
31 #endif
32 
33 #endif /* !DEBUG_PRINT_H_ */