From ef0c6c6aee0080456ccab4ab4597f782295090a7 Mon Sep 17 00:00:00 2001 From: Timo Schulz Date: Wed, 9 Mar 2005 11:47:21 +0000 Subject: [PATCH] 2005-03-07 Timo Schulz * gpgme.h: [_WIN32] Removed ssize_t typedef. * ath.h: [_WIN32] Added some (dummy) types. * io.h: [_WIN32] include stdio.h. * data.h: [_WIN32] Define EOPNOTSUPP. * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New. * gpgme.c [_WIN32] (gpgme_set_locale): Disabled. --- trunk/gpgme/ChangeLog | 9 +++++++++ trunk/gpgme/ath-compat.c | 1 + trunk/gpgme/ath.h | 18 +++++++++++++----- trunk/gpgme/data.h | 4 ++++ trunk/gpgme/engine-gpgsm.c | 2 ++ trunk/gpgme/gpgme.c | 4 +++- trunk/gpgme/gpgme.h | 3 --- trunk/gpgme/io.h | 4 ++++ trunk/gpgme/w32-io.c | 12 ++++++++++-- trunk/gpgme/w32-sema.c | 1 + trunk/gpgme/w32-util.c | 5 +++-- 11 files changed, 50 insertions(+), 13 deletions(-) diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 47eb3aa..dc398fe 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,12 @@ +2005-03-07 Timo Schulz + + * gpgme.h: [_WIN32] Removed ssize_t typedef. + * ath.h: [_WIN32] Added some (dummy) types. + * io.h: [_WIN32] include stdio.h. + * data.h: [_WIN32] Define EOPNOTSUPP. + * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New. + * gpgme.c [_WIN32] (gpgme_set_locale): Disabled. + 2004-12-12 Marcus Brinkmann * engine.c (_gpgme_set_engine_info): Fix assertion. diff --git a/trunk/gpgme/ath-compat.c b/trunk/gpgme/ath-compat.c index 71ca6bc..110bd51 100644 --- a/trunk/gpgme/ath-compat.c +++ b/trunk/gpgme/ath-compat.c @@ -23,6 +23,7 @@ #endif #include +#include #ifdef HAVE_SYS_SELECT_H # include #else diff --git a/trunk/gpgme/ath.h b/trunk/gpgme/ath.h index 17fb1fd..ef74126 100644 --- a/trunk/gpgme/ath.h +++ b/trunk/gpgme/ath.h @@ -21,13 +21,21 @@ #ifndef ATH_H #define ATH_H -#ifdef HAVE_SYS_SELECT_H -# include +#ifdef _WIN32 +struct msghdr { int dummy; }; +typedef int socklen_t; +# include +# include #else -# include +# ifdef HAVE_SYS_SELECT_H +# include +# else +# include +# endif +# include +# include #endif -#include -#include + /* Define _ATH_EXT_SYM_PREFIX if you want to give all external symbols diff --git a/trunk/gpgme/data.h b/trunk/gpgme/data.h index feb4a60..02ada89 100644 --- a/trunk/gpgme/data.h +++ b/trunk/gpgme/data.h @@ -30,6 +30,10 @@ #include "gpgme.h" +#ifdef _WIN32 +# define EOPNOTSUPP 95 +#endif + /* Read up to SIZE bytes into buffer BUFFER from the data object with the handle DH. Return the number of characters read, 0 on EOF and diff --git a/trunk/gpgme/engine-gpgsm.c b/trunk/gpgme/engine-gpgsm.c index 6aae018..71b01c9 100644 --- a/trunk/gpgme/engine-gpgsm.c +++ b/trunk/gpgme/engine-gpgsm.c @@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _WIN32 #if HAVE_CONFIG_H #include #endif @@ -1596,3 +1597,4 @@ struct engine_ops _gpgme_engine_ops_gpgsm = gpgsm_io_event, gpgsm_cancel }; +#endif diff --git a/trunk/gpgme/gpgme.c b/trunk/gpgme/gpgme.c index 338d728..f95ae3f 100644 --- a/trunk/gpgme/gpgme.c +++ b/trunk/gpgme/gpgme.c @@ -344,6 +344,7 @@ gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs) gpgme_error_t gpgme_set_locale (gpgme_ctx_t ctx, int category, const char *value) { +#ifndef _WIN32 int failed = 0; char *new_lc_ctype; char *new_lc_messages; @@ -397,7 +398,8 @@ gpgme_set_locale (gpgme_ctx_t ctx, int category, const char *value) SET_ONE_LOCALE (messages, MESSAGES); if (!ctx) UNLOCK (def_lc_lock); - +#endif + return 0; } diff --git a/trunk/gpgme/gpgme.h b/trunk/gpgme/gpgme.h index 397e31b..2e22113 100644 --- a/trunk/gpgme/gpgme.h +++ b/trunk/gpgme/gpgme.h @@ -38,9 +38,6 @@ typedef long ssize_t; #else # include -#ifdef _WIN32 -typedef long ssize_t; -#endif #endif #ifdef __cplusplus diff --git a/trunk/gpgme/io.h b/trunk/gpgme/io.h index f490e52..58de071 100644 --- a/trunk/gpgme/io.h +++ b/trunk/gpgme/io.h @@ -22,6 +22,10 @@ #ifndef IO_H #define IO_H +#ifdef _WIN32 +#include +#endif + /* A single file descriptor passed to spawn. For child fds, dup_to specifies the fd it should become in the child. */ struct spawn_fd_item_s diff --git a/trunk/gpgme/w32-io.c b/trunk/gpgme/w32-io.c index 5b64120..7defc3c 100644 --- a/trunk/gpgme/w32-io.c +++ b/trunk/gpgme/w32-io.c @@ -37,7 +37,7 @@ #include "util.h" #include "sema.h" #include "io.h" - +#include "debug.h" /* We assume that a HANDLE can be represented by an int which should be true for all i386 systems (HANDLE is defined as void *) and @@ -1064,7 +1064,7 @@ _gpgme_io_select ( struct io_select_fd_s *fds, size_t nfds, int nonblock ) */ any = 0; for (i=code - WAIT_OBJECT_0; i < nwait; i++ ) { - if (WaitForSingleObject ( waitbuf[i], NULL ) == WAIT_OBJECT_0) { + if (WaitForSingleObject (waitbuf[i], 0) == WAIT_OBJECT_0) { assert (waitidx[i] >=0 && waitidx[i] < nfds); fds[waitidx[i]].signaled = 1; any = 1; @@ -1116,3 +1116,11 @@ _gpgme_io_select ( struct io_select_fd_s *fds, size_t nfds, int nonblock ) return count; } + +void +_gpgme_io_subsystem_init (void) +{ + +} + + diff --git a/trunk/gpgme/w32-sema.c b/trunk/gpgme/w32-sema.c index d2c0c5c..c20f1a7 100644 --- a/trunk/gpgme/w32-sema.c +++ b/trunk/gpgme/w32-sema.c @@ -36,6 +36,7 @@ #include "util.h" #include "sema.h" +#include "debug.h" static void sema_fatal (const char *text) diff --git a/trunk/gpgme/w32-util.c b/trunk/gpgme/w32-util.c index c62637a..5254fcc 100644 --- a/trunk/gpgme/w32-util.c +++ b/trunk/gpgme/w32-util.c @@ -37,6 +37,7 @@ #include "util.h" #include "sema.h" +#include "debug.h" DEFINE_STATIC_LOCK (get_path_lock); @@ -119,7 +120,7 @@ _gpgme_get_gpg_path (void) LOCK (get_path_lock); if (!gpg_program) - gpg_program = find_program_in_registry ("gpgProgram"); + gpg_program = (char*)find_program_in_registry ("gpgProgram"); #ifdef GPG_PATH if (!gpg_program) gpg_program = GPG_PATH; @@ -135,7 +136,7 @@ _gpgme_get_gpgsm_path (void) LOCK (get_path_lock); if (!gpgsm_program) - gpgsm_program = find_program_in_registry ("gpgsmProgram"); + gpgsm_program = (char*)find_program_in_registry ("gpgsmProgram"); #ifdef GPGSM_PATH if (!gpgsm_program) gpgsm_program = GPGSM_PATH; -- 2.26.2