root/masterdriverz/use-expand/src/py24-compatibility.h @ marienz%2540gentoo.org-20061119201324-2fb0008e4120bac2

Revision marienz%2540gentoo.org-20061119201324-2fb0008e4120bac2, 0.9 kB (checked in by Marien Zwart <marienz@…>, 2 years ago)

Move everything from src/extensions to src/

Line 
1/*
2 * Copyright: 2006 Brian Harring <ferringb@gmail.com>
3 * Copyright: 2006 Marien Zwart <marienz@gentoo.org>
4 * License: GPL2
5 *
6 * C version of some of pkgcore (for extra speed).
7 */
8
9/* This does not really do anything since we do not use the "#"
10 * specifier in a PyArg_Parse or similar call, but hey, not using it
11 * means we are Py_ssize_t-clean too!
12 */
13
14#ifndef PKGCORE_COMMON_INCLUDE
15#define PKGCORE_COMMON_INCLUDE 1
16
17/* Compatibility with python < 2.5 */
18
19#if PY_VERSION_HEX < 0x02050000
20typedef int Py_ssize_t;
21#define PY_SSIZE_T_MAX INT_MAX
22#define PY_SSIZE_T_MIN INT_MIN
23typedef Py_ssize_t (*lenfunc)(PyObject *);
24#endif
25
26/* From heapy */
27#include "heapdef.h"
28
29/* Copied from stdtypes.c in guppy */
30#define INTERATTR(name) \
31    if ((PyObject *)v->name == r->tgt &&                                \
32        (r->visit(NYHR_INTERATTR, PyString_FromString(#name), r)))      \
33                return 1;
34
35#endif
Note: See TracBrowser for help on using the browser.