From 294b14228a6c4de1c5d2cf38e3b83430e73ad8e6 Mon Sep 17 00:00:00 2001 From: Bart Janssens Date: Fri, 15 Apr 2022 00:47:21 +0200 Subject: [PATCH] Fix embedding with MSVC (#44976) (cherry picked from commit c589e0d59541b1240f5bf77c7ce8c22594179e1b) --- src/support/dtypes.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/support/dtypes.h b/src/support/dtypes.h index 46780e8e64d4a..3e2fa18b0a67b 100644 --- a/src/support/dtypes.h +++ b/src/support/dtypes.h @@ -29,6 +29,16 @@ #include #include +#if defined(_COMPILER_MICROSOFT_) && !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) + +/* See https://github.com/JuliaLang/julia/pull/44587 */ +typedef intptr_t ssize_t; +#define SSIZE_MAX INTPTR_MAX +#define _SSIZE_T_ +#define _SSIZE_T_DEFINED + +#endif /* defined(_COMPILER_MICROSOFT_) && !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) */ + #if !defined(_COMPILER_GCC_) #define strtoull _strtoui64