iotaledger / pyota-ccurl

C Curl extension for PyOTA
MIT License
3 stars 8 forks source link

Does not compile in Python 2.7 #4

Closed todofixthis closed 7 years ago

todofixthis commented 7 years ago

The extension won't compile in Python 2.7:

    src/ccurlmodule.c:205:8: error: unknown type name 'PyModuleDef'
    static PyModuleDef ccurlmodule = {
           ^
    src/ccurlmodule.c:206:3: error: use of undeclared identifier 'PyModuleDef_HEAD_INIT'
      PyModuleDef_HEAD_INIT,
      ^
    src/ccurlmodule.c:220:5: error: void function 'PyInit_ccurl' should not return a value [-Wreturn-type]
        return NULL;
        ^      ~~~~
    src/ccurlmodule.c:222:7: warning: implicit declaration of function 'PyModule_Create' is invalid in C99 [-Wimplicit-function-declaration]
      m = PyModule_Create(&ccurlmodule);
          ^
    src/ccurlmodule.c:224:5: error: void function 'PyInit_ccurl' should not return a value [-Wreturn-type]
        return NULL;
        ^      ~~~~
    src/ccurlmodule.c:228:5: error: void function 'PyInit_ccurl' should not return a value [-Wreturn-type]
        return NULL;
        ^      ~~~~
    src/ccurlmodule.c:238:3: error: void function 'PyInit_ccurl' should not return a value [-Wreturn-type]
      return m;
      ^      ~
    1 warning and 6 errors generated.
    error: command '/usr/bin/clang' failed with exit status 1

This appears to be due to changes introduced in the Python C API during the transition to version 3:
https://docs.python.org/3/howto/cporting.html