diff --git a/display.c b/display.c index 3751b0a2b..830dd3fe9 100644 --- a/display.c +++ b/display.c @@ -399,7 +399,7 @@ static BOOL CALLBACK list_windows_callback(HWND hwnd, LPARAM lParam) GetWindowRect(hwnd, &outer); item = Py_BuildValue( - "lN(iiii)(iiii)", (long) hwnd, title, + "nN(iiii)(iiii)", (Py_ssize_t) hwnd, title, inner.left, inner.top, inner.right, inner.bottom, outer.left, outer.top, outer.right, outer.bottom ); @@ -743,7 +743,7 @@ PyImaging_CreateWindowWin32(PyObject* self, PyObject* args) SetForegroundWindow(wnd); /* to make sure it's visible */ Py_END_ALLOW_THREADS - return Py_BuildValue("l", (long) wnd); + return Py_BuildValue("n", (Py_ssize_t) wnd); } PyObject*