aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/ath.c8
-rw-r--r--src/ath.h3
-rw-r--r--src/data-compat.c8
-rw-r--r--src/w32-ce.h14
5 files changed, 42 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f4e0e7d0..8736644e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-15 Werner Koch <[email protected]>
+
+ * data-compat.c (gpgme_data_new_from_filepart)
+ (gpgme_data_new_from_file) [W32CE && _MSC_VER]: Return not
+ GPG_ERR_NOT_IMPLEMENTED.
+
+ * w32-ce.h (HKEY_PERFORMANCE_DATA, HKEY_CURRENT_CONFIG, _IOLBF)
+ (abort) [_MSC_VER]: Provide these macros.
+
+ * ath.h [W32CE && _MSC_VER]: Include winsock2.h.
+
+ * ath.c (ath_read, ath_write) [W32CE && _MSC_VER]: Do not call
+ non-available functions.
+
2010-11-04 Werner Koch <[email protected]>
* w32-ce.h [_MSC_VER && W32CE]: Undef leave.
diff --git a/src/ath.c b/src/ath.c
index e5acbdaa..e5b9964e 100644
--- a/src/ath.c
+++ b/src/ath.c
@@ -128,14 +128,22 @@ ath_mutex_unlock (ath_mutex_t *lock)
ssize_t
ath_read (int fd, void *buf, size_t nbytes)
{
+#if defined(HAVE_W32CE_SYSTEM) && defined(_MSC_VER)
+ return -1; /* Not supported. */
+#else
return read (fd, buf, nbytes);
+#endif
}
ssize_t
ath_write (int fd, const void *buf, size_t nbytes)
{
+#if defined(HAVE_W32CE_SYSTEM) && defined(_MSC_VER)
+ return -1; /* Not supported. */
+#else
return write (fd, buf, nbytes);
+#endif
}
diff --git a/src/ath.h b/src/ath.h
index 424e3456..9ada5502 100644
--- a/src/ath.h
+++ b/src/ath.h
@@ -28,6 +28,9 @@
/* fixme: Check how we did it in libgcrypt. */
struct msghdr { int dummy; };
typedef int socklen_t;
+# if defined(HAVE_W32CE_SYSTEM) && defined(_MSC_VER)
+# include <winsock2.h>
+# endif
# include <windows.h>
# include <io.h>
diff --git a/src/data-compat.c b/src/data-compat.c
index bf615386..39c743ef 100644
--- a/src/data-compat.c
+++ b/src/data-compat.c
@@ -43,6 +43,9 @@ gpgme_error_t
gpgme_data_new_from_filepart (gpgme_data_t *r_dh, const char *fname,
FILE *stream, off_t offset, size_t length)
{
+#if defined (HAVE_W32CE_SYSTEM) && defined (_MSC_VER)
+ return gpgme_error (GPG_ERR_NOT_IMPLEMENTED);
+#else
gpgme_error_t err;
char *buf = NULL;
int res;
@@ -111,6 +114,7 @@ gpgme_data_new_from_filepart (gpgme_data_t *r_dh, const char *fname,
(*r_dh)->data.mem.length = length;
return TRACE_SUC1 ("r_dh=%p", *r_dh);
+#endif
}
@@ -119,6 +123,9 @@ gpgme_data_new_from_filepart (gpgme_data_t *r_dh, const char *fname,
gpgme_error_t
gpgme_data_new_from_file (gpgme_data_t *r_dh, const char *fname, int copy)
{
+#if defined (HAVE_W32CE_SYSTEM) && defined (_MSC_VER)
+ return gpgme_error (GPG_ERR_NOT_IMPLEMENTED);
+#else
gpgme_error_t err;
struct stat statbuf;
TRACE_BEG3 (DEBUG_DATA, "gpgme_data_new_from_filepart", r_dh,
@@ -132,6 +139,7 @@ gpgme_data_new_from_file (gpgme_data_t *r_dh, const char *fname, int copy)
err = gpgme_data_new_from_filepart (r_dh, fname, NULL, 0, statbuf.st_size);
return TRACE_ERR (err);
+#endif
}
diff --git a/src/w32-ce.h b/src/w32-ce.h
index fafaa06c..a74c6e17 100644
--- a/src/w32-ce.h
+++ b/src/w32-ce.h
@@ -32,7 +32,6 @@ typedef int pid_t;
#include <ws2tcpip.h> /* For getaddrinfo. */
#include <windows.h>
-
#define getenv _gpgme_wince_getenv
char *getenv (const char *name);
@@ -75,11 +74,16 @@ void *_gpgme_wince_bsearch (const void *key, const void *base,
int (*compar) (const void *, const void *));
#define bsearch(a,b,c,d,e) _gpgme_wince_bsearch ((a),(b),(c),(d),(e))
-/* Remove the redefined __leave keyword. It is defined by MSC for W32
- in excpt.h and not in sehmap.h as for the plain windows
- version. */
-#if defined(_MSC_VER) && defined(HAVE_W32CE_SYSTEM)
+#if defined(_MSC_VER)
+ /* Remove the redefined __leave keyword. It is defined by MSC for
+ W32 in excpt.h and not in sehmap.h as for the plain windows
+ version. */
# undef leave
+# define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004)
+# define HKEY_CURRENT_CONFIG ((HKEY)0x80000005)
+ /* Replace the Mingw32CE provided abort function. */
+# define abort() do { TerminateProcess (GetCurrentProcess(), 8); } while (0)
+# define _IOLBF 0x40
#endif
#endif /* GPGME_W32_CE_H */