summaryrefslogtreecommitdiffstats
path: root/PC/winreg.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-03-16 06:03:37 (GMT)
committerGitHub <noreply@github.com>2021-03-16 06:03:37 (GMT)
commit651fc30af7ac6138764106b87632cabca56a98bb (patch)
treec656dd7a77205b7925b74a34ab34d73d5445e2a6 /PC/winreg.c
parenta838e477a009bae4549f10bfd3396b8d5678415d (diff)
downloadcpython-651fc30af7ac6138764106b87632cabca56a98bb.zip
cpython-651fc30af7ac6138764106b87632cabca56a98bb.tar.gz
cpython-651fc30af7ac6138764106b87632cabca56a98bb.tar.bz2
bpo-43499: Silence compiler warnings about using legacy C API on Windows (GH-24873)
Diffstat (limited to 'PC/winreg.c')
-rw-r--r--PC/winreg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index 1305b70..01e3e9f 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -646,7 +646,10 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
t = PyList_GET_ITEM(value, j);
if (!PyUnicode_Check(t))
return FALSE;
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
wstr = PyUnicode_AsUnicodeAndSize(t, &len);
+_Py_COMP_DIAG_POP
if (wstr == NULL)
return FALSE;
size += Py_SAFE_DOWNCAST((len + 1) * sizeof(wchar_t),
@@ -669,7 +672,10 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
Py_ssize_t len;
t = PyList_GET_ITEM(value, j);
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
wstr = PyUnicode_AsUnicodeAndSize(t, &len);
+_Py_COMP_DIAG_POP
assert(wstr);
wcscpy(P, wstr);
P += (len + 1);