aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2018-09-07 13:07:20 -0700
committerJosh Haberman <jhaberman@gmail.com>2018-09-07 13:07:20 -0700
commite53be9bce4556cf0d13e24f1a25a7d75f663144f (patch)
treede23a02851fd46f4b8032033ea6b162ac441d104
parentf14064184cc31668b44df2bcf8654c0b7da6b9db (diff)
downloadprotobuf-e53be9bce4556cf0d13e24f1a25a7d75f663144f.tar.gz
protobuf-e53be9bce4556cf0d13e24f1a25a7d75f663144f.tar.bz2
protobuf-e53be9bce4556cf0d13e24f1a25a7d75f663144f.zip
Fixed Python extension compile.
-rw-r--r--python/google/protobuf/pyext/message.cc12
-rw-r--r--python/google/protobuf/pyext/message_module.cc2
2 files changed, 7 insertions, 7 deletions
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
index f42d9be2..fecb9364 100644
--- a/python/google/protobuf/pyext/message.cc
+++ b/python/google/protobuf/pyext/message.cc
@@ -644,7 +644,7 @@ void OutOfRangeError(PyObject* arg) {
template<class RangeType, class ValueType>
bool VerifyIntegerCastAndRange(PyObject* arg, ValueType value) {
- if (ABSL_PREDICT_FALSE(value == -1 && PyErr_Occurred())) {
+ if (PROTOBUF_PREDICT_FALSE(value == -1 && PyErr_Occurred())) {
if (PyErr_ExceptionMatches(PyExc_OverflowError)) {
// Replace it with the same ValueError as pure python protos instead of
// the default one.
@@ -653,7 +653,7 @@ bool VerifyIntegerCastAndRange(PyObject* arg, ValueType value) {
} // Otherwise propagate existing error.
return false;
}
- if (ABSL_PREDICT_FALSE(!IsValidNumericCast<RangeType>(value))) {
+ if (PROTOBUF_PREDICT_FALSE(!IsValidNumericCast<RangeType>(value))) {
OutOfRangeError(arg);
return false;
}
@@ -680,7 +680,7 @@ bool CheckAndGetInteger(PyObject* arg, T* value) {
// an integer and can be used as an ordinal number".
// This definition includes everything that implements numbers.Integral
// and shouldn't cast the net too wide.
- if (ABSL_PREDICT_FALSE(!PyIndex_Check(arg))) {
+ if (PROTOBUF_PREDICT_FALSE(!PyIndex_Check(arg))) {
FormatTypeError(arg, "int, long");
return false;
}
@@ -697,7 +697,7 @@ bool CheckAndGetInteger(PyObject* arg, T* value) {
// Unlike PyLong_AsLongLong, PyLong_AsUnsignedLongLong is very
// picky about the exact type.
PyObject* casted = PyNumber_Long(arg);
- if (ABSL_PREDICT_FALSE(casted == nullptr)) {
+ if (PROTOBUF_PREDICT_FALSE(casted == nullptr)) {
// Propagate existing error.
return false;
}
@@ -722,7 +722,7 @@ bool CheckAndGetInteger(PyObject* arg, T* value) {
// Valid subclasses of numbers.Integral should have a __long__() method
// so fall back to that.
PyObject* casted = PyNumber_Long(arg);
- if (ABSL_PREDICT_FALSE(casted == nullptr)) {
+ if (PROTOBUF_PREDICT_FALSE(casted == nullptr)) {
// Propagate existing error.
return false;
}
@@ -748,7 +748,7 @@ template bool CheckAndGetInteger<uint64>(PyObject*, uint64*);
bool CheckAndGetDouble(PyObject* arg, double* value) {
*value = PyFloat_AsDouble(arg);
- if (ABSL_PREDICT_FALSE(*value == -1 && PyErr_Occurred())) {
+ if (PROTOBUF_PREDICT_FALSE(*value == -1 && PyErr_Occurred())) {
FormatTypeError(arg, "int, long, float");
return false;
}
diff --git a/python/google/protobuf/pyext/message_module.cc b/python/google/protobuf/pyext/message_module.cc
index b8e28df4..8d465eb5 100644
--- a/python/google/protobuf/pyext/message_module.cc
+++ b/python/google/protobuf/pyext/message_module.cc
@@ -31,7 +31,7 @@
#include <Python.h>
#include <google/protobuf/pyext/message.h>
-#include <google/protobuf/python/proto_api.h>
+#include <google/protobuf/proto_api.h>
#include <google/protobuf/message_lite.h>