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
@@ -182,10 +182,21 @@ static PyMethodDef mMethods[] = {
182182
183183};
184184
185+ #if PY_MAJOR_VERSION >= 3
186+
185187static struct PyModuleDef moduledef = {PyModuleDef_HEAD_INIT, " tinyobjloader" ,
186188 NULL , -1 , mMethods };
187189
188190PyMODINIT_FUNC PyInit_tinyobjloader (void ) {
189191 return PyModule_Create (&moduledef);
190192}
193+
194+ #else
195+
196+ PyMODINIT_FUNC inittinyobjloader (void ) {
197+ Py_InitModule3 (" tinyobjloader" , mMethods , NULL );
198+ }
199+
200+ #endif // PY_MAJOR_VERSION >= 3
201+
191202}
You can’t perform that action at this time.
0 commit comments