File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11* PBR material
22* Define index_t struct
3- * Python 2.7 binding
Original file line number Diff line number Diff line change 1- // python3 module for tinyobjloader
1+ // python2/3 module for tinyobjloader
22//
33// usage:
44// import tinyobjloader as tol
@@ -183,10 +183,21 @@ static PyMethodDef mMethods[] = {
183183
184184};
185185
186+ #if PY_MAJOR_VERSION >= 3
187+
186188static struct PyModuleDef moduledef = {PyModuleDef_HEAD_INIT, " tinyobjloader" ,
187189 NULL , -1 , mMethods };
188190
189191PyMODINIT_FUNC PyInit_tinyobjloader (void ) {
190192 return PyModule_Create (&moduledef);
191193}
194+
195+ #else
196+
197+ PyMODINIT_FUNC inittinyobjloader (void ) {
198+ Py_InitModule3 (" tinyobjloader" , mMethods , NULL );
199+ }
200+
201+ #endif // PY_MAJOR_VERSION >= 3
202+
192203}
You can’t perform that action at this time.
0 commit comments