diff options
author | Werner Koch <[email protected]> | 2004-12-18 17:12:17 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2004-12-18 17:12:17 +0000 |
commit | 4ccc9cadfe442f0ecd05f6e3b0fb11560861f70a (patch) | |
tree | 18df6d8907f7036583aa1129d2fffa1b952a9e85 /src/assuan-logging.c | |
parent | * configure.ac: Define HAVE_W32_SYSTEM and HAVE_DOSISH_SYSTEM. (diff) | |
download | libassuan-4ccc9cadfe442f0ecd05f6e3b0fb11560861f70a.tar.gz libassuan-4ccc9cadfe442f0ecd05f6e3b0fb11560861f70a.zip |
* autogen.sh: Add Option --build-w32.
* assuan-logging.c (_assuan_w32_strerror): New.
* assuan-defs.h (w32_strerror): new.
* assuan-pipe-connect.c (assuan_pipe_connect2, fix_signals):
Factored signal code out to new function.
(build_w32_commandline, create_inheritable_pipe): New. Taken
from gnupg 1.9.
(assuan_pipe_connect2) [W32]: Implemented for W32.
Diffstat (limited to 'src/assuan-logging.c')
-rw-r--r-- | src/assuan-logging.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/assuan-logging.c b/src/assuan-logging.c index d677664..7c65d57 100644 --- a/src/assuan-logging.c +++ b/src/assuan-logging.c @@ -21,11 +21,14 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif - -#include "assuan-defs.h" #include <stdio.h> #include <string.h> #include <stdarg.h> +#ifdef HAVE_W32_SYSTEM +#include <windows.h> +#endif /*HAVE_W32_SYSTEM*/ + +#include "assuan-defs.h" static char prefix_buffer[80]; static FILE *_assuan_log; @@ -90,3 +93,20 @@ _assuan_log_printf (const char *format, ...) vfprintf (fp, format, arg_ptr ); va_end (arg_ptr); } + + + +#ifdef HAVE_W32_SYSTEM +const char * +_assuan_w32_strerror (int ec) +{ + static char strerr[256]; + + if (ec == -1) + ec = (int)GetLastError (); + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, ec, + MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), + strerr, sizeof (strerr)-1, NULL); + return strerr; +} +#endif /*HAVE_W32_SYSTEM*/ |