[pypy-commit] pypy pypy3-release-2.6.x: small win32 fixes
mattip
noreply at buildbot.pypy.org
Thu Jun 25 01:03:22 CEST 2015
Author: mattip <matti.picus at gmail.com>
Branch: pypy3-release-2.6.x
Changeset: r78306:f3ccad00bee4
Date: 2015-06-25 01:55 +0300
http://bitbucket.org/pypy/pypy/changeset/f3ccad00bee4/
Log: small win32 fixes
diff --git a/pypy/module/_codecs/locale_codec.c b/pypy/module/_codecs/locale_codec.c
--- a/pypy/module/_codecs/locale_codec.c
+++ b/pypy/module/_codecs/locale_codec.c
@@ -17,11 +17,12 @@
#define PyMem_Free free
/* C99 but recent Windows has it */
#define HAVE_MBRTOWC 1
-/* Hopefully? */
-#define HAVE_LANGINFO_H
#ifdef MS_WINDOWS
# include <windows.h>
+#else
+/* Hopefully? */
+#define HAVE_LANGINFO_H
#endif
#ifdef HAVE_LANGINFO_H
diff --git a/pypy/module/posix/interp_nt.py b/pypy/module/posix/interp_nt.py
--- a/pypy/module/posix/interp_nt.py
+++ b/pypy/module/posix/interp_nt.py
@@ -79,7 +79,7 @@
with lltype.scoped_alloc(
win32traits.BY_HANDLE_FILE_INFORMATION) as info:
if win32traits.GetFileInformationByHandle(hFile, info) == 0:
- raise rwin32.lastWindowsError("_getfileinformation")
+ raise rwin32.lastSavedWindowsError("_getfileinformation")
return (rffi.cast(lltype.Signed, info.c_dwVolumeSerialNumber),
rffi.cast(lltype.Signed, info.c_nFileIndexHigh),
rffi.cast(lltype.Signed, info.c_nFileIndexLow))
@@ -101,7 +101,7 @@
win32traits.FILE_FLAG_BACKUP_SEMANTICS,
rwin32.NULL_HANDLE)
if hFile == rwin32.INVALID_HANDLE_VALUE:
- raise rwin32.lastWindowsError("CreateFile")
+ raise rwin32.lastSavedWindowsError("CreateFile")
VOLUME_NAME_DOS = rffi.cast(rwin32.DWORD, win32traits.VOLUME_NAME_DOS)
try:
@@ -111,7 +111,7 @@
rffi.cast(rwin32.DWORD, 0),
VOLUME_NAME_DOS)
if usize == 0:
- raise rwin32.lastWindowsError("GetFinalPathNameByHandle")
+ raise rwin32.lastSavedWindowsError("GetFinalPathNameByHandle")
size = rffi.cast(lltype.Signed, usize)
with rffi.scoped_alloc_unicodebuffer(size + 1) as buf:
@@ -121,7 +121,7 @@
usize,
VOLUME_NAME_DOS)
if result == 0:
- raise rwin32.lastWindowsError("GetFinalPathNameByHandle")
+ raise rwin32.lastSavedWindowsError("GetFinalPathNameByHandle")
return buf.str(rffi.cast(lltype.Signed, result))
finally:
rwin32.CloseHandle(hFile)
diff --git a/pypy/module/time/interp_time.py b/pypy/module/time/interp_time.py
--- a/pypy/module/time/interp_time.py
+++ b/pypy/module/time/interp_time.py
@@ -186,7 +186,7 @@
"RPY_EXTERN "
"char** pypy_get_tzname();\n"
"RPY_EXTERN "
- "void* pypy__tzset();"],
+ "void pypy__tzset();"],
separate_module_sources = ["""
long pypy_get_timezone() { return timezone; }
int pypy_get_daylight() { return daylight; }
More information about the pypy-commit
mailing list