mirror of
https://github.com/wiire-a/pixiewps.git
synced 2025-07-28 08:14:39 +02:00
fix DEBUG macros to be usable like a generic function call
the macros were broken for use in a context like if(foo) DEBUG_XXX(); else DEBUG_XXX(); since multiple statements were executed.
This commit is contained in:
parent
efd4c4427a
commit
f2490d219b
@ -45,12 +45,12 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
# define DEBUG_PRINT(fmt, args...); fprintf(stderr, "\n [DEBUG] %s:%d:%s(): " fmt, \
|
# define DEBUG_PRINT(fmt, args...) do { fprintf(stderr, "\n [DEBUG] %s:%d:%s(): " fmt, \
|
||||||
__FILE__, __LINE__, __func__, ##args); fflush(stdout);
|
__FILE__, __LINE__, __func__, ##args); fflush(stdout); } while (0)
|
||||||
# define DEBUG_PRINT_ARRAY(b, l); byte_array_print(b, l); fflush(stdout);
|
# define DEBUG_PRINT_ARRAY(b, l) do { byte_array_print(b, l); fflush(stdout); } while (0)
|
||||||
#else
|
#else
|
||||||
# define DEBUG_PRINT(fmt, args...)
|
# define DEBUG_PRINT(fmt, args...) do {} while (0)
|
||||||
# define DEBUG_PRINT_ARRAY(b, l)
|
# define DEBUG_PRINT_ARRAY(b, l) do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint_fast8_t p_mode[MODE_LEN] = { 0 };
|
uint_fast8_t p_mode[MODE_LEN] = { 0 };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user