aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/udfs/common/python/bindings/py27_backports.h
blob: 766af6a76fa34a4bc18e450b25c370e600f7c8be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "Python.h"

#ifdef __cplusplus
extern "C" {
#endif

// Declare functions which are to be backported
// (see details about need for backports in ya.make)

int _PySlice_Unpack(PyObject *slice,
                    Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);

Py_ssize_t _PySlice_AdjustIndices(Py_ssize_t length,
                                  Py_ssize_t *start, Py_ssize_t *stop,
                                  Py_ssize_t step);

// Declare py23 compatible names

#define PySlice_Unpack _PySlice_Unpack
#define PySlice_AdjustIndices _PySlice_AdjustIndices

#ifdef __cplusplus
}
#endif