diff options
| author | Werner Koch <[email protected]> | 2025-08-22 12:43:48 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2025-08-22 12:44:15 +0000 |
| commit | 7cf19d055929bbaa37b7195a0abe442a7f20b512 (patch) | |
| tree | 9416ea18223114bd03f629b1987526bce46ac223 /common/sysutils.c | |
| parent | gpg: Fix list of possible algos for --edit-key. (diff) | |
| download | gnupg-7cf19d055929bbaa37b7195a0abe442a7f20b512.tar.gz gnupg-7cf19d055929bbaa37b7195a0abe442a7f20b512.zip | |
common: Add a wrapper around the W32 OutputDebugString function.
* common/sysutils.c (output_debug_string): New.
Diffstat (limited to 'common/sysutils.c')
| -rw-r--r-- | common/sysutils.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/common/sysutils.c b/common/sysutils.c index 2bacae2ea..2e39d4737 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -2007,3 +2007,25 @@ open_stream_nc (gnupg_fd_t fd, const char *mode) return es_sysopen_nc (&syshd, mode); } + + +/* Debug helper to track down problems with logging under Windows. */ +void +output_debug_string (const char *format, ...) +{ +#ifdef HAVE_W32_SYSTEM + char *buf; + va_list arg_ptr; + + va_start (arg_ptr, format); + buf = gpgrt_vbsprintf (format, arg_ptr); + va_end (arg_ptr); + if (buf) + OutputDebugStringA (buf); + else + OutputDebugStringA ("vbsprintf failed"); + gpgrt_free (buf); +#else + (void)format; +#endif +} |
