You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2010-12-28.09:30:50.547>created_at=<Date2010-12-26.17:27:42.488>labels= ['docs']
title='"Building C and C++ Extensions on Windows" documentation shows 2.x way of initializing module'updated_at=<Date2010-12-28.09:30:50.545>user='https://bugs.python.org/thorstenbehrens'
>
If your module creates a new type, you may have trouble with this line:
PyVarObject_HEAD_INIT(&PyType_Type, 0)
Static type object initializers in extension modules may cause compiles to fail with an error message like “initializer not a constant”. This shows up when building DLL under MSVC. Change it to:
PyVarObject_HEAD_INIT(NULL, 0)
and add the following to the module initialization function:
MyObject_Type.ob_type = &PyType_Type;
>
That last line will not function in Python 3.x. However, PyType_Ready will fill in the ob_type field if it is empty, if I understand PyType_Ready correctly. Therefore, the last few lines of this documentation snippet can become:
>
and add the following to the module initialization function:
if (PyType_Ready(&MyObject_Type) < 0)
return NULL;
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: