From 521ec40aea89a3e172874ccdef359e87b25f1242 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 18 Jul 2023 14:21:19 +0900 Subject: [PATCH] common,w32: Fix FD2INT macro. * common/sysutils.h [HAVE_W32_SYSTEM] (FD2INT): Use intptr_t for 64-bit Windows. -- GnuPG-bug-id: 6598 Signed-off-by: NIIBE Yutaka --- common/sysutils.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/sysutils.h b/common/sysutils.h index 180e82df8..e34fff72f 100644 --- a/common/sysutils.h +++ b/common/sysutils.h @@ -38,7 +38,11 @@ typedef void *gnupg_fd_t; #define GNUPG_INVALID_FD ((void*)(-1)) #define INT2FD(s) ((void *)(s)) -#define FD2INT(h) ((unsigned int)(h)) +# ifdef _WIN64 +# define FD2INT(h) ((intptr_t)(h)) +# else +# define FD2INT(h) ((unsigned int)(h)) +# endif #define FD_DBG(h) ((int)(intptr_t)(h)) #else typedef int gnupg_fd_t;