diff --git a/src/wrapper/_pvt_struct_v2.cpp b/src/wrapper/_pvt_struct_v2.cpp
index 28cc3ed6917bfe71196cba299f4e8af1ba17e096..31a16a825559222e521c40f2ffec768b12e36ff2 100644
--- a/src/wrapper/_pvt_struct_v2.cpp
+++ b/src/wrapper/_pvt_struct_v2.cpp
@@ -19,7 +19,9 @@
 
 /* compatibility macros */
 #if (PY_VERSION_HEX < 0x02050000)
+#ifndef PY_SSIZE_T_MIN
 typedef long int Py_ssize_t;
+#endif
 
 #define PyInt_FromSsize_t(x) PyInt_FromLong(x)
 #define PyInt_AsSsize_t(x) PyInt_AsLong(x)