aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/pyext/map_container.h
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2015-12-22 11:13:03 -0800
committerJosh Haberman <jhaberman@gmail.com>2015-12-30 16:09:53 -0800
commite1abdf2c762cdddfbbd2c916cbc663914e858a01 (patch)
tree201e38c9feb9f4a2ea2fa88caa9bbca153a3932a /python/google/protobuf/pyext/map_container.h
parentd5fb408ddc281ffcadeb08699e65bb694656d0bd (diff)
downloadprotobuf-e1abdf2c762cdddfbbd2c916cbc663914e858a01.tar.gz
protobuf-e1abdf2c762cdddfbbd2c916cbc663914e858a01.tar.bz2
protobuf-e1abdf2c762cdddfbbd2c916cbc663914e858a01.zip
Fixed compile for Python 3. There are still some crashes though.
Diffstat (limited to 'python/google/protobuf/pyext/map_container.h')
-rw-r--r--python/google/protobuf/pyext/map_container.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/python/google/protobuf/pyext/map_container.h b/python/google/protobuf/pyext/map_container.h
index 2de61187..ddf94be7 100644
--- a/python/google/protobuf/pyext/map_container.h
+++ b/python/google/protobuf/pyext/map_container.h
@@ -111,8 +111,16 @@ struct MessageMapContainer : public MapContainer {
PyObject* message_dict;
};
-extern PyTypeObject ScalarMapContainer_Type;
-extern PyTypeObject MessageMapContainer_Type;
+#if PY_MAJOR_VERSION >= 3
+ extern PyObject *MessageMapContainer_Type;
+ extern PyType_Spec MessageMapContainer_Type_spec;
+ extern PyObject *ScalarMapContainer_Type;
+ extern PyType_Spec ScalarMapContainer_Type_spec;
+#else
+ extern PyTypeObject MessageMapContainer_Type;
+ extern PyTypeObject ScalarMapContainer_Type;
+#endif
+
extern PyTypeObject MapIterator_Type; // Both map types use the same iterator.
// Builds a MapContainer object, from a parent message and a