diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 47eb3aa2..dc398fe7 100644 --- a/gpgme/ChangeLog +++ b/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/gpgme/ath-compat.c b/gpgme/ath-compat.c index 71ca6bc4..110bd51c 100644 --- a/gpgme/ath-compat.c +++ b/gpgme/ath-compat.c @@ -23,6 +23,7 @@ #endif #include +#include #ifdef HAVE_SYS_SELECT_H # include #else diff --git a/gpgme/ath.h b/gpgme/ath.h index 17fb1fd9..ef74126a 100644 --- a/gpgme/ath.h +++ b/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/gpgme/data.h b/gpgme/data.h index feb4a60a..02ada89e 100644 --- a/gpgme/data.h +++ b/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/gpgme/engine-gpgsm.c b/gpgme/engine-gpgsm.c index 6aae0183..71b01c9f 100644 --- a/gpgme/engine-gpgsm.c +++ b/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/gpgme/gpgme.c b/gpgme/gpgme.c index 338d7285..f95ae3fd 100644 --- a/gpgme/gpgme.c +++ b/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/gpgme/gpgme.h b/gpgme/gpgme.h index 397e31bb..2e22113a 100644 --- a/gpgme/gpgme.h +++ b/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/gpgme/io.h b/gpgme/io.h index f490e52b..58de0714 100644 --- a/gpgme/io.h +++ b/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/gpgme/w32-io.c b/gpgme/w32-io.c index 5b64120b..7defc3cc 100644 --- a/gpgme/w32-io.c +++ b/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/gpgme/w32-sema.c b/gpgme/w32-sema.c index d2c0c5c0..c20f1a7b 100644 --- a/gpgme/w32-sema.c +++ b/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/gpgme/w32-util.c b/gpgme/w32-util.c index c62637a8..5254fcce 100644 --- a/gpgme/w32-util.c +++ b/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;