Make more compatible with old C extensions using the PyDateTime_... objects

Closed Bitbucket Importer requested to merge topic/default/bitbucket-pr-622 into branch/default

Created originally on Bitbucket by ashwinahuja (Ashwin Ahuja)

Encountered lots of problems in an old C extension I was trying to get working with PyPy, to do with missing things inside datetime.h (and cpyext_datetime.h).

Idea is to bring everything a bit closer to: https://github.com/python/cpython/blob/master/Include/datetime.h

Included in this is 'long hashcode' in:
PyDateTime_Delta
PyDateTime_Time
PyDateTime_DateTime
PyDateTime_Date

Also added 'unsigned char fold' (+ new constructors that let this be used) to:
PyDateTime_Time
PyDateTime_DateTime

And: 'unsigned char data[...]' to:
PyDateTime_Time
PyDateTime_Date
PyDateTime_DateTime

Finally, added the objects:
_PyDateTime_BaseTime
_PyDateTime_BaseDateTime

Also brought across DATETIME_API_MAGIC which is a part of CPython and I found I had a reliance on (therefore others might have the same thing)

Merge request reports