- Provide fully flexible PR_DEBUGF
read_file = false;
break;
default:
- PR_DEBUG("Marker was expected but it was not found\n");
+ PR_DEBUGF("%s %lu\n", "Marker was expected but it was not found at:", segments_read);
free(*pairs);
*pairs = NULL;
return PARSE_E_NOT_FOUND;
#endif
#ifndef NDEBUG
-#define PR_DEBUG(msg) fprintf(stderr, msg)
+ #ifdef _MSC_VER
+ #define __func__ __FUNCTION__
+ #endif
+ #define PR_DEBUGF(fmt, ...) fprintf(stderr, "[%s()] "fmt, __func__, __VA_ARGS__)
+ #define PR_DEBUG(msg) fprintf(stderr, "[%s()] "msg, __func__)
#else
-#define PR_DEBUG(msg)
+ #define PR_DEBUGF(fmt, msg)
+ #define PR_DEBUG(msg)
#endif