aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2013-06-19 11:29:18 +0000
committerWerner Koch <[email protected]>2013-06-19 11:29:18 +0000
commit6ba18ca32c8669fa76cc10de3382f78212ca51a8 (patch)
tree5f380a9a829d26ca4fff42a2e03d6fb7f3afff9c /src
parentAdd hack to have different names for 64 bit Windows DLLs. (diff)
downloadlibassuan-6ba18ca32c8669fa76cc10de3382f78212ca51a8.tar.gz
libassuan-6ba18ca32c8669fa76cc10de3382f78212ca51a8.zip
Changes to support W64.
* configure.ac (have_dosish_system): Set for W64. * src/assuan-defs.h (SOCKET2HANDLE, HANDLE2SOCKET): Add versions for W64. * src/assuan-handler.c (assuan_command_parse_fd) [W64]: Use strtoull to parse an FD. -- Note that these changes are not complete but merely sufficient to allow building of GpgEX.
Diffstat (limited to 'src')
-rw-r--r--src/assuan-defs.h13
-rw-r--r--src/assuan-handler.c6
2 files changed, 11 insertions, 8 deletions
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index f6cb9b4..63329c8 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -397,12 +397,15 @@ int _assuan_asprintf (char **buf, const char *fmt, ...);
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
-#if HAVE_W32_SYSTEM
-#define SOCKET2HANDLE(s) ((void *)(s))
-#define HANDLE2SOCKET(h) ((unsigned int)(h))
+#if HAVE_W64_SYSTEM
+# define SOCKET2HANDLE(s) ((void *)(s))
+# define HANDLE2SOCKET(h) ((uintptr_t)(h))
+#elif HAVE_W32_SYSTEM
+# define SOCKET2HANDLE(s) ((void *)(s))
+# define HANDLE2SOCKET(h) ((unsigned int)(h))
#else
-#define SOCKET2HANDLE(s) (s)
-#define HANDLE2SOCKET(h) (h)
+# define SOCKET2HANDLE(s) (s)
+# define HANDLE2SOCKET(h) (h)
#endif
diff --git a/src/assuan-handler.c b/src/assuan-handler.c
index dca5968..2fa91b8 100644
--- a/src/assuan-handler.c
+++ b/src/assuan-handler.c
@@ -271,9 +271,9 @@ assuan_command_parse_fd (assuan_context_t ctx, char *line, assuan_fd_t *rfd)
line ++;
if (!digitp (*line))
return set_error (ctx, GPG_ERR_ASS_SYNTAX, "number required");
-#ifdef HAVE_W32_SYSTEM
- /* Fixme: For a W32/64bit system we will need to change the cast
- and the conversion function. */
+#if HAVE_W64_SYSTEM
+ *rfd = (void*)strtoull (line, &endp, 10);
+#elif HAVE_W32_SYSTEM
*rfd = (void*)strtoul (line, &endp, 10);
#else
*rfd = strtoul (line, &endp, 10);