Hi Konstantin,
On 5/7/23 16:12, Konstantin Kostiuk wrote:
Signed-off-by: Konstantin Kostiuk <[email protected]>
---
qga/vss-win32/vss-debug.h | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 qga/vss-win32/vss-debug.h
+#define PRINT_DEBUG(fmt, ...) { \
+ char user_sting[512] = { 0 }; \
+ char full_string[640] = { 0 }; \
+ snprintf(user_sting, 512, fmt, ## __VA_ARGS__); \
+ snprintf(full_string, 640, QGA_PROVIDER_NAME"[%lu]: %s %s\n", \
+ GetCurrentThreadId(), __func__, user_sting); \
+ OutputDebugString(full_string); \
+ fprintf(stderr, "%s", full_string); \
+}
Why not simply use a plain function?
+#define PRINT_DEBUG_BEGIN PRINT_DEBUG("begin")
+#define PRINT_DEBUG_END PRINT_DEBUG("end")
+
+#endif