libjapi  0.3.2
Universal JSON API Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
prntdbg.h
Go to the documentation of this file.
1 
34 /*
35  * some preprocessor workarounds according to www.decompile.com/cpp/faq/file_and_line_error_string.htm
36  */
37 #define STRINGIFY(x) #x
38 #define TOSTRING(x) STRINGIFY(x)
39 
40 #if defined(__GNUC__)
41  /* gcc's cpp has extensions; it allows for macros with a variable number of
42  arguments. */
43  #if !defined(NDEBUG)
44  #define prntdbg(format, ...) fprintf(stderr, __FILE__ "(" TOSTRING(__LINE__) "): \t" format, ##__VA_ARGS__)
45  #else
46  #define prntdbg(format, ...) ((void)0)
47  #endif /* defined(NODEBUG) */
48 #else
49  /* This compiler does not have extensions, so we just rename the function */
50  #define prntdbg printf
51 #endif