|
23 | 23 | #include <string> |
24 | 24 | #include <utility> |
25 | 25 |
|
26 | | -#include <string.h> |
| 26 | +#include <cstring> |
27 | 27 |
|
28 | 28 | #if defined(__cpp_lib_launder) && !(defined(_MSC_VER) && (_MSC_VER < 1914)) |
29 | 29 | # define PYBIND11_STD_LAUNDER std::launder |
@@ -327,8 +327,8 @@ class cpp_function : public function { |
327 | 327 | a.descr = guarded_strdup(repr(a.value).cast<std::string>().c_str()); |
328 | 328 | } |
329 | 329 |
|
330 | | - rec->is_constructor |
331 | | - = (strcmp(rec->name, "__init__") == 0) || (strcmp(rec->name, "__setstate__") == 0); |
| 330 | + rec->is_constructor = (std::strcmp(rec->name, "__init__") == 0) |
| 331 | + || (std::strcmp(rec->name, "__setstate__") == 0); |
332 | 332 |
|
333 | 333 | #if !defined(NDEBUG) && !defined(PYBIND11_DISABLE_NEW_STYLE_INIT_WARNING) |
334 | 334 | if (rec->is_constructor && !rec->is_new_style_constructor) { |
@@ -409,10 +409,10 @@ class cpp_function : public function { |
409 | 409 | pybind11_fail("Internal error while parsing type signature (2)"); |
410 | 410 |
|
411 | 411 | #if PY_MAJOR_VERSION < 3 |
412 | | - if (strcmp(rec->name, "__next__") == 0) { |
| 412 | + if (std::strcmp(rec->name, "__next__") == 0) { |
413 | 413 | std::free(rec->name); |
414 | 414 | rec->name = guarded_strdup("next"); |
415 | | - } else if (strcmp(rec->name, "__bool__") == 0) { |
| 415 | + } else if (std::strcmp(rec->name, "__bool__") == 0) { |
416 | 416 | std::free(rec->name); |
417 | 417 | rec->name = guarded_strdup("__nonzero__"); |
418 | 418 | } |
@@ -1302,8 +1302,8 @@ inline void call_operator_delete(void *p, size_t s, size_t a) { |
1302 | 1302 |
|
1303 | 1303 | inline void add_class_method(object& cls, const char *name_, const cpp_function &cf) { |
1304 | 1304 | cls.attr(cf.name()) = cf; |
1305 | | - if (strcmp(name_, "__eq__") == 0 && !cls.attr("__dict__").contains("__hash__")) { |
1306 | | - cls.attr("__hash__") = none(); |
| 1305 | + if (std::strcmp(name_, "__eq__") == 0 && !cls.attr("__dict__").contains("__hash__")) { |
| 1306 | + cls.attr("__hash__") = none(); |
1307 | 1307 | } |
1308 | 1308 | } |
1309 | 1309 |
|
|
0 commit comments