mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
Minor fix for MSVC warning CS4459 (#1374)
When using pybind11 to bind enums on MSVC and warnings (/W4) enabled, the following warning pollutes builds. This fix renames one of the occurrences. pybind11\include\pybind11\pybind11.h(1398): warning C4459: declaration of 'self' hides global declaration pybind11\include\pybind11\operators.h(41): note: see declaration of 'pybind11::detail::self'
This commit is contained in:
parent
ffd56ebec0
commit
ed67005583
@ -1389,9 +1389,9 @@ public:
|
|||||||
}
|
}
|
||||||
return pybind11::str("???");
|
return pybind11::str("???");
|
||||||
});
|
});
|
||||||
def_property_readonly_static("__doc__", [m_entries_ptr](handle self) {
|
def_property_readonly_static("__doc__", [m_entries_ptr](handle self_) {
|
||||||
std::string docstring;
|
std::string docstring;
|
||||||
const char *tp_doc = ((PyTypeObject *) self.ptr())->tp_doc;
|
const char *tp_doc = ((PyTypeObject *) self_.ptr())->tp_doc;
|
||||||
if (tp_doc)
|
if (tp_doc)
|
||||||
docstring += std::string(tp_doc) + "\n\n";
|
docstring += std::string(tp_doc) + "\n\n";
|
||||||
docstring += "Members:";
|
docstring += "Members:";
|
||||||
@ -1404,7 +1404,7 @@ public:
|
|||||||
}
|
}
|
||||||
return docstring;
|
return docstring;
|
||||||
});
|
});
|
||||||
def_property_readonly_static("__members__", [m_entries_ptr](handle /* self */) {
|
def_property_readonly_static("__members__", [m_entries_ptr](handle /* self_ */) {
|
||||||
dict m;
|
dict m;
|
||||||
for (const auto &kv : reinterpret_borrow<dict>(m_entries_ptr))
|
for (const auto &kv : reinterpret_borrow<dict>(m_entries_ptr))
|
||||||
m[kv.first] = kv.second[int_(0)];
|
m[kv.first] = kv.second[int_(0)];
|
||||||
|
Loading…
Reference in New Issue
Block a user