Listing 7 printf.h, version 2

#ifndef PRINTF_H
#define PRINTF_H

#ifndef NDEBUG

#ifdef printf
#undef printf
#endif
#define printf (*Ptr_printf(__FILE__, \
             STRx2(__LINE__)))

#define STRx2(tokens) STRx1(tokens)
#define STRx1(tokens) #tokens

typedef int
PrintfLike(const char format[], ...);
PrintfLike * Ptr_printf(const char file[],
                    const char line[]);

#endif /* NDEBUG */
#endif /* PRINTF_H */

/* End of File */