Skip to content

Commit 3774165

Browse files
committed
math_opt: Fix elemental python on windows
ssize_t is not part of the STL, python provides `Py_ssize_t` ref: https://peps.python.org/pep-0353/
1 parent 0de1006 commit 3774165

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ortools/math_opt/elemental/python/elemental.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class AttrKeyArrayView {
177177
}
178178
}
179179

180-
ssize_t size() const { return array_.shape(0); }
180+
Py_ssize_t size() const { return array_.shape(0); }
181181

182182
AttrKeyT operator[](const int64_t i) const {
183183
std::array<int64_t, AttrKeyT::size()> key_ids;
@@ -565,7 +565,7 @@ PYBIND11_MODULE(cpp_elemental, py_module) {
565565
const int64_t num_elements = static_cast<int64_t>(names.shape(0));
566566
const char* unicode_data =
567567
static_cast<const char*>(names.request().ptr);
568-
const ssize_t itemsize_bytes = names.request().itemsize;
568+
const Py_ssize_t itemsize_bytes = names.request().itemsize;
569569
py::array_t<int64_t> result(names.size());
570570
auto ids = result.mutable_unchecked<1>();
571571
for (int i = 0; i < num_elements; ++i) {

0 commit comments

Comments
 (0)