diff options
Diffstat (limited to 'python/google/protobuf/pyext/map_container.h')
-rw-r--r-- | python/google/protobuf/pyext/map_container.h | 12 |
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 |