[pypy-dev] PyPy's PyDateTime_Delta definition

Amaury Forgeot d'Arc amauryfa at gmail.com
Sat Sep 7 12:19:54 CEST 2013


2013/9/7 Skip Montanaro <skip at pobox.com>

> On Fri, Sep 6, 2013 at 6:13 PM, Skip Montanaro <skip at pobox.com> wrote:
> >> Not sure I understand. Or did you mean "why are those declarations not
> in
> >> datetime.h"?
> >
> > Yes, sorry about the typo.
>
> Alas, I am still confused. The PyDateTime_DELTA_GET_* macros aren't
> defined for CPython until the 3.x series. (There are macros in 2.7,
> but they are defined in datetimemodule.c, not in a public header file.
> PyPy declares them as functions.
>
> Is there some predefined "This is PyPy" macro I can check?
>

Now I feel embarrassed.
I was the one who added these macros to CPython 3.3, exactly for this
reason.
see the patch we propose for cx_Oracle:
https://bitbucket.org/pypy/pypy/src/tip/pypy/module/cpyext/patches/cx_Oracle.patch
"#ifdef PyDateTime_DELTA_GET_DAYS" should do the trick for any version.

-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20130907/9bee66e7/attachment.html>


More information about the pypy-dev mailing list