Changeset 391 for python/trunk/Doc/extending/windows.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/extending/windows.rst
r2 r391 99 99 not necessarily have to match the module name, but the name of the 100 100 initialization function should match the module name --- you can only import a 101 module :mod:`spam` if its initialization function is called :c func:`initspam`,102 and it should call :c func:`Py_InitModule` with the string ``"spam"`` as its101 module :mod:`spam` if its initialization function is called :c:func:`initspam`, 102 and it should call :c:func:`Py_InitModule` with the string ``"spam"`` as its 103 103 first argument (use the minimal :file:`example.c` in this directory as a guide). 104 104 By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`. … … 115 115 116 116 #. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to 117 117 :file:`spam.\*`, and edit them by hand, or 118 118 119 119 #. Create a brand new project; instructions are below. … … 176 176 PyObject_HEAD_INIT(&PyType_Type) 177 177 178 Change it to:: 178 Static type object initializers in extension modules may cause 179 compiles to fail with an error message like "initializer not a 180 constant". This shows up when building DLL under MSVC. Change it to:: 179 181 180 182 PyObject_HEAD_INIT(NULL) … … 182 184 and add the following to the module initialization function:: 183 185 184 MyObject_Type.ob_type = &PyType_Type; 185 186 Refer to section 3 of the `Python FAQ <http://www.python.org/doc/faq>`_ for 187 details on why you must do this. 186 if (PyType_Ready(&MyObject_Type) < 0) 187 return NULL; 188 188 189 189 … … 264 264 The first command created three files: :file:`spam.obj`, :file:`spam.dll` and 265 265 :file:`spam.lib`. :file:`Spam.dll` does not contain any Python functions (such 266 as :c func:`PyArg_ParseTuple`), but it does know how to find the Python code266 as :c:func:`PyArg_ParseTuple`), but it does know how to find the Python code 267 267 thanks to :file:`pythonXY.lib`. 268 268
Note:
See TracChangeset
for help on using the changeset viewer.