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
/*  ∙ If a file contains only function declaration and/or #define symbols or macros, then the file
 *    should be ▒.h.
 *  ∙ Only #include a ▒.h file, never a ▒.c file.
 */

#ifndef __DBG_LOG_H__
#define __DBG_LOG_H__

#ifdef ENABLE_DEBUGGING_CODE
    // ENABLE
#   define dbg_log_int(n) (printf("# %s == %d\n", (#n), (n)))
    // Reminder:  #n means the text of the expression passed to the function-like macro.
#   define dbg_printf(...)   printf(__VA_ARGS__)
    // different from vaarg from HW05!!!
#else
    // DISABLE
#   define dbg_log_int(n)
    // Invocations to the function-like macro disappear.
    // ∙ dbg_log_int(divisor);  ⇒   ;
#   define dbg_printf(...)
#endif

#endif /* end of include guard: __DBG_LOG_H__ */

/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */

© Copyright 2021 Alexander J. Quinn         This content is protected and may not be shared, uploaded, or distributed.