Commits

Anonymous committed 9ecbce5

SF Bug #1448488 - make collectionsmodule build on Cygwin, using the same
techniques as in Modules/xxsubtype.c

Comments (0)

Files changed (1)

Modules/collectionsmodule.c

 A defaultdict compares equal to a dict with the same items.\n\
 ");
 
+/* See comment in xxsubtype.c */
+#define DEFERRED_ADDRESS(ADDR) 0
+
 static PyTypeObject defdict_type = {
-	PyObject_HEAD_INIT(NULL)
+	PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type))
 	0,				/* ob_size */
 	"collections.defaultdict",	/* tp_name */
 	sizeof(defdictobject),		/* tp_basicsize */
 	defdict_methods,		/* tp_methods */
 	defdict_members,		/* tp_members */
 	0,				/* tp_getset */
-	&PyDict_Type,			/* tp_base */
+	DEFERRED_ADDRESS(&PyDict_Type),	/* tp_base */
 	0,				/* tp_dict */
 	0,				/* tp_descr_get */
 	0,				/* tp_descr_set */
 	Py_INCREF(&deque_type);
 	PyModule_AddObject(m, "deque", (PyObject *)&deque_type);
 
+	defdict_type.tp_base = &PyDict_Type;
 	if (PyType_Ready(&defdict_type) < 0)
 		return;
 	Py_INCREF(&defdict_type);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.