From 203c593b9681d98e7e05f3d8f862aa183f5d9c91 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Mon, 10 Jan 2022 21:40:56 +0000 Subject: [PATCH] Fix build error with Python 3.10 build on Windows The Windows build for Python 3.10 is giving us an error about ssize_t being undefined, so this commit fixes the problem by replacing it with Py_ssize_t, which is consistent with what we do elsewhere in the file. --- python/google/protobuf/pyext/unknown_fields.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/google/protobuf/pyext/unknown_fields.cc b/python/google/protobuf/pyext/unknown_fields.cc index b9ca6ad3b0f31..6d919b361ad94 100644 --- a/python/google/protobuf/pyext/unknown_fields.cc +++ b/python/google/protobuf/pyext/unknown_fields.cc @@ -219,7 +219,7 @@ const UnknownField* GetUnknownField(PyUnknownFieldRef* self) { "The parent message might be cleared."); return NULL; } - ssize_t total_size = fields->field_count(); + Py_ssize_t total_size = fields->field_count(); if (self->index >= total_size) { PyErr_Format(PyExc_ValueError, "UnknownField does not exist. "