encukou / py3c

A Python 2/3 compatibility layer for C extensions
http://py3c.readthedocs.org
MIT License
59 stars 20 forks source link

inline isn't defined on (some versions of) visual studio #11

Closed jonathanunderwood closed 7 years ago

jonathanunderwood commented 7 years ago

With the Visual Studio compiler, at least for older versions often usedd to build extensions for earlier versions of Python (eg 2.6), "inline" isn't defined, but __inline is. This causes a compilation error:

py3c\py3c/compat.h(76) : error C2054: expected '(' to follow 'inline'

There's a fairly simple fix:

#if defined(_WIN32) && defined(_MSC_VER)
#define inline __inline
#endif
encukou commented 7 years ago

Interesting, thanks for the report! In that case I'd rather just remove inline from py3c.