rickardp / splitstream

Continuous object splitter for C and Python
Apache License 2.0
44 stars 9 forks source link

Add support for Windows #9

Closed kennethkaane closed 4 years ago

kennethkaane commented 4 years ago

Build error in Windows is caused by &PyType_Type which is a PyObject* as the type of a type object is 'type', but this isn’t strictly conforming C and some compilers, e.g Visual C and MinGW's gcc, complain.

So we change:

https://github.com/rickardp/splitstream/blob/6f188a96f6dff02643029b4c8ddd771effd91aa7/src/python/splitstream_py.c#L106

to:

PyVarObject_HEAD_INIT(NULL, 0)

Fortunately, this member will be filled in for us by PyType_Ready() making everything work.

Tested on Windows and Ubuntu.

rickardp commented 4 years ago

Looks like it’s working fine. Thanks!