diff --git a/ortools/base/logging.h b/ortools/base/logging.h index 7a698461ef..b2ee3f6aff 100644 --- a/ortools/base/logging.h +++ b/ortools/base/logging.h @@ -25,5 +25,6 @@ #include "ortools/base/macros.h" #define QCHECK CHECK +#define ABSL_DIE_IF_NULL CHECK_NOTNULL #endif // OR_TOOLS_BASE_LOGGING_H_ diff --git a/ortools/base/python-swig.h b/ortools/base/python-swig.h index 513b50ea38..235e9d96da 100644 --- a/ortools/base/python-swig.h +++ b/ortools/base/python-swig.h @@ -43,7 +43,7 @@ static inline int PyString_AsStringAndSize(PyObject* obj, char** buf, Py_ssize_t* psize) { if (PyUnicode_Check(obj)) { - *buf = const_cast(PyUnicode_AsUTF8AndSize(obj, psize)); + *buf = PyUnicode_AsUTF8AndSize(obj, psize); return *buf == NULL ? -1 : 0; } else if (PyBytes_Check(obj)) { return PyBytes_AsStringAndSize(obj, buf, psize); @@ -85,7 +85,7 @@ inline bool PyObjAs(PyObject* pystr, std::string* cstr) { Py_ssize_t len; #if PY_VERSION_HEX >= 0x03030000 if (PyUnicode_Check(pystr)) { - buf = const_cast(PyUnicode_AsUTF8AndSize(pystr, &len)); + buf = PyUnicode_AsUTF8AndSize(pystr, &len); if (!buf) return false; } else // NOLINT #endif