From c483a4f122ff2484606cbc3e78283c26c28d84c2 Mon Sep 17 00:00:00 2001 From: Adrien Guinet Date: Tue, 13 Oct 2020 08:04:00 +0200 Subject: [PATCH] Fix ssize_t windows definition to be compatible with LLVM's --- include/dffi/compat.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/dffi/compat.h b/include/dffi/compat.h index a07d5e21..66f155b1 100644 --- a/include/dffi/compat.h +++ b/include/dffi/compat.h @@ -40,8 +40,15 @@ #endif #if defined(_MSC_VER) -#include -typedef SSIZE_T ssize_t; +// LLVM's C API defines "by hand" ssize_t. We need to do the same otherwise we +// got a conflicting type... +// #include +// typedef SSIZE_T ssize_t; +#if defined(_WIN64) +typedef signed __int64 ssize_t; +#else +typedef signed int ssize_t; +#endif /* _WIN64 */ #endif