From 404fa924c373da02965206d6a90a65d4a46bd046 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 2 Jan 2013 18:22:23 +0200 Subject: [PATCH] Issue #16841: Set st_dev on Windows as unsigned long to match its DWORD type. --- Modules/posixmodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index e53e76cef55..bd483fa4473 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1951,7 +1951,9 @@ _pystat_fromstructstat(STRUCT_STAT *st) #else PyStructSequence_SET_ITEM(v, 1, PyLong_FromLong((long)st->st_ino)); #endif -#if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS) +#ifdef MS_WINDOWS + PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev)); +#elif defined(HAVE_LONG_LONG) PyStructSequence_SET_ITEM(v, 2, PyLong_FromLongLong((PY_LONG_LONG)st->st_dev)); #else