source: pyyaml/trunk/ext/_yaml.h @ 339

Revision 339, 476 bytes checked in by xi, 5 years ago (diff)

Added a MS VC 6.0 compatibility hack against Cython-generated C sources.

RevLine 
[195]1
[205]2#include <yaml.h>
[195]3
[334]4#if PY_MAJOR_VERSION < 3
[331]5
[335]6#define PyUnicode_FromString(s) PyUnicode_DecodeUTF8((s), strlen(s), "strict")
[334]7
8#else
9
[331]10#define PyString_CheckExact PyBytes_CheckExact
11#define PyString_AS_STRING  PyBytes_AS_STRING
12#define PyString_GET_SIZE   PyBytes_GET_SIZE
13#define PyString_FromStringAndSize  PyBytes_FromStringAndSize
14
15#endif
[339]16
17#ifdef _MSC_VER /* MS Visual C++ 6.0 */
18#if _MSC_VER == 1200
19
20#define PyLong_FromUnsignedLongLong(z)  PyInt_FromLong(i)
21
22#endif
23#endif
Note: See TracBrowser for help on using the repository browser.