Commit e1abdf2c authored by Josh Haberman's avatar Josh Haberman

Fixed compile for Python 3. There are still some crashes though.

parent d5fb408d
......@@ -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
......
......@@ -162,7 +162,7 @@ if __name__ == '__main__':
extra_compile_args = ['-Wno-write-strings', '-Wno-invalid-offsetof']
test_conformance.target = 'test_python_cpp'
if "clang" in os.popen('$CC --version').read():
if "clang" in os.popen('$CC --version 2> /dev/null').read():
extra_compile_args.append('-Wno-shorten-64-to-32')
if warnings_as_errors in sys.argv:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment