From 4ccc9cadfe442f0ecd05f6e3b0fb11560861f70a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sat, 18 Dec 2004 17:12:17 +0000 Subject: * 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. --- src/assuan-logging.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/assuan-logging.c') 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 #endif - -#include "assuan-defs.h" #include #include #include +#ifdef HAVE_W32_SYSTEM +#include +#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*/ -- cgit v1.2.3