if (!PyArg_ParseTuple(args, "U|i:LoadLibrary", &nameobj, &load_flags))
return NULL;
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
name = _PyUnicode_AsUnicode(nameobj);
+_Py_COMP_DIAG_POP
if (!name)
return NULL;
if (!PyUnicode_FSDecoder(nameobj, &stringobj)) {
return -1;
}
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
widename = PyUnicode_AsUnicode(stringobj);
+_Py_COMP_DIAG_POP
if (widename == NULL)
return -1;
#else
if (is_unicode) {
#ifdef MS_WINDOWS
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
wide = PyUnicode_AsUnicodeAndSize(o, &length);
+_Py_COMP_DIAG_POP
if (!wide) {
goto error_exit;
}
goto error_exit;
}
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
wide = PyUnicode_AsUnicodeAndSize(wo, &length);
+_Py_COMP_DIAG_POP
if (!wide) {
goto error_exit;
}
#ifdef MS_WINDOWS
if (!PyUnicode_FSDecoder(self->path, &ub))
return NULL;
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
const wchar_t *path = PyUnicode_AsUnicode(ub);
+_Py_COMP_DIAG_POP
#else /* POSIX */
if (!PyUnicode_FSConverter(self->path, &ub))
return NULL;
if (!PyUnicode_FSDecoder(self->path, &unicode))
return NULL;
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
path = PyUnicode_AsUnicode(unicode);
+_Py_COMP_DIAG_POP
result = LSTAT(path, &stat);
Py_DECREF(unicode);
goto onError;
}
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
repwstr = PyUnicode_AsUnicodeAndSize(repunicode, &repwlen);
+_Py_COMP_DIAG_POP
if (repwstr == NULL)
goto onError;
/* need more space? (at least enough for what we
substring = PyUnicode_Substring(unicode, offset, offset+len);
if (substring == NULL)
return -1;
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
p = PyUnicode_AsUnicodeAndSize(substring, &size);
+_Py_COMP_DIAG_POP
if (p == NULL) {
Py_DECREF(substring);
return -1;
return NULL;
if (PyUnicode_Check(data)) {
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
const WCHAR *value = _PyUnicode_AsUnicode(data);
+_Py_COMP_DIAG_POP
if (value == NULL) {
return NULL;
}
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),
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);
_Py_CheckPython3();
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
wpathname = _PyUnicode_AsUnicode(pathname);
+_Py_COMP_DIAG_POP
if (wpathname == NULL)
return NULL;
struct _stat wstatbuf;
const wchar_t *wpath;
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
wpath = _PyUnicode_AsUnicode(path);
+_Py_COMP_DIAG_POP
if (wpath == NULL)
return -2;
Py_TYPE(path));
return NULL;
}
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
wpath = _PyUnicode_AsUnicode(path);
+_Py_COMP_DIAG_POP
if (wpath == NULL)
return NULL;