From 93fd1a06d68bb7212a2bce95f5faa053fbd471bf Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Sun, 5 Jan 2020 19:00:43 +0200 Subject: [PATCH] client/common: do better job to use proper Py_ssize_t type --- client/common/Python-dynload.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/common/Python-dynload.h b/client/common/Python-dynload.h index ea59745b..1083c5c1 100644 --- a/client/common/Python-dynload.h +++ b/client/common/Python-dynload.h @@ -1,6 +1,9 @@ #ifndef PYTHON_DYNLOAD_H #define PYTHON_DYNLOAD_H +#include +#include + typedef void *PyObject; typedef void *PyCodeObject; @@ -21,12 +24,12 @@ struct py_imports { void (*proc)(); }; +#if defined(_MSC_VER) && _MSC_VER < 1600 + #define ssize_t signed long long +#endif + #ifndef Py_ssize_t - #ifdef ssize_t - typedef ssize_t Py_ssize_t; - #else - typedef signed long long Py_ssize_t; - #endif + #define Py_ssize_t ssize_t #endif #ifndef BOOL