2005-03-07 Timo Schulz <twoaday@g10code.de>

* 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.
This commit is contained in:
Timo Schulz 2005-03-09 11:47:21 +00:00
parent 7d10a7f296
commit 2d5f4c8188
11 changed files with 50 additions and 13 deletions

View File

@ -1,3 +1,12 @@
2005-03-07 Timo Schulz <twoaday@g10code.de>
* 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 <marcus@g10code.de> 2004-12-12 Marcus Brinkmann <marcus@g10code.de>
* engine.c (_gpgme_set_engine_info): Fix assertion. * engine.c (_gpgme_set_engine_info): Fix assertion.

View File

@ -23,6 +23,7 @@
#endif #endif
#include <unistd.h> #include <unistd.h>
#include <stdio.h>
#ifdef HAVE_SYS_SELECT_H #ifdef HAVE_SYS_SELECT_H
# include <sys/select.h> # include <sys/select.h>
#else #else

View File

@ -21,13 +21,21 @@
#ifndef ATH_H #ifndef ATH_H
#define ATH_H #define ATH_H
#ifdef HAVE_SYS_SELECT_H #ifdef _WIN32
# include <sys/select.h> struct msghdr { int dummy; };
typedef int socklen_t;
# include <windows.h>
# include <io.h>
#else #else
# include <sys/time.h> # ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
# else
# include <sys/time.h>
# endif
# include <sys/types.h>
# include <sys/socket.h>
#endif #endif
#include <sys/types.h>
#include <sys/socket.h>
/* Define _ATH_EXT_SYM_PREFIX if you want to give all external symbols /* Define _ATH_EXT_SYM_PREFIX if you want to give all external symbols

View File

@ -30,6 +30,10 @@
#include "gpgme.h" #include "gpgme.h"
#ifdef _WIN32
# define EOPNOTSUPP 95
#endif
/* Read up to SIZE bytes into buffer BUFFER from the data object with /* 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 the handle DH. Return the number of characters read, 0 on EOF and

View File

@ -19,6 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */ 02111-1307, USA. */
#ifndef _WIN32
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
@ -1596,3 +1597,4 @@ struct engine_ops _gpgme_engine_ops_gpgsm =
gpgsm_io_event, gpgsm_io_event,
gpgsm_cancel gpgsm_cancel
}; };
#endif

View File

@ -344,6 +344,7 @@ gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs)
gpgme_error_t gpgme_error_t
gpgme_set_locale (gpgme_ctx_t ctx, int category, const char *value) gpgme_set_locale (gpgme_ctx_t ctx, int category, const char *value)
{ {
#ifndef _WIN32
int failed = 0; int failed = 0;
char *new_lc_ctype; char *new_lc_ctype;
char *new_lc_messages; 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); SET_ONE_LOCALE (messages, MESSAGES);
if (!ctx) if (!ctx)
UNLOCK (def_lc_lock); UNLOCK (def_lc_lock);
#endif
return 0; return 0;
} }

View File

@ -38,9 +38,6 @@
typedef long ssize_t; typedef long ssize_t;
#else #else
# include <sys/types.h> # include <sys/types.h>
#ifdef _WIN32
typedef long ssize_t;
#endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -22,6 +22,10 @@
#ifndef IO_H #ifndef IO_H
#define IO_H #define IO_H
#ifdef _WIN32
#include <stdio.h>
#endif
/* A single file descriptor passed to spawn. For child fds, dup_to /* A single file descriptor passed to spawn. For child fds, dup_to
specifies the fd it should become in the child. */ specifies the fd it should become in the child. */
struct spawn_fd_item_s struct spawn_fd_item_s

View File

@ -37,7 +37,7 @@
#include "util.h" #include "util.h"
#include "sema.h" #include "sema.h"
#include "io.h" #include "io.h"
#include "debug.h"
/* We assume that a HANDLE can be represented by an int which should /* 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 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; any = 0;
for (i=code - WAIT_OBJECT_0; i < nwait; i++ ) { 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); assert (waitidx[i] >=0 && waitidx[i] < nfds);
fds[waitidx[i]].signaled = 1; fds[waitidx[i]].signaled = 1;
any = 1; any = 1;
@ -1116,3 +1116,11 @@ _gpgme_io_select ( struct io_select_fd_s *fds, size_t nfds, int nonblock )
return count; return count;
} }
void
_gpgme_io_subsystem_init (void)
{
}

View File

@ -36,6 +36,7 @@
#include "util.h" #include "util.h"
#include "sema.h" #include "sema.h"
#include "debug.h"
static void static void
sema_fatal (const char *text) sema_fatal (const char *text)

View File

@ -37,6 +37,7 @@
#include "util.h" #include "util.h"
#include "sema.h" #include "sema.h"
#include "debug.h"
DEFINE_STATIC_LOCK (get_path_lock); DEFINE_STATIC_LOCK (get_path_lock);
@ -119,7 +120,7 @@ _gpgme_get_gpg_path (void)
LOCK (get_path_lock); LOCK (get_path_lock);
if (!gpg_program) if (!gpg_program)
gpg_program = find_program_in_registry ("gpgProgram"); gpg_program = (char*)find_program_in_registry ("gpgProgram");
#ifdef GPG_PATH #ifdef GPG_PATH
if (!gpg_program) if (!gpg_program)
gpg_program = GPG_PATH; gpg_program = GPG_PATH;
@ -135,7 +136,7 @@ _gpgme_get_gpgsm_path (void)
LOCK (get_path_lock); LOCK (get_path_lock);
if (!gpgsm_program) if (!gpgsm_program)
gpgsm_program = find_program_in_registry ("gpgsmProgram"); gpgsm_program = (char*)find_program_in_registry ("gpgsmProgram");
#ifdef GPGSM_PATH #ifdef GPGSM_PATH
if (!gpgsm_program) if (!gpgsm_program)
gpgsm_program = GPGSM_PATH; gpgsm_program = GPGSM_PATH;