Is Python2 / 64 bit supported?

49 views
Skip to first unread message

wolfgang61

unread,
Jan 23, 2017, 7:10:57 AM1/23/17
to libHaru
After adding some more debug output, it can be seen that Python gets all 64 bits for a pointer, but
when it passes the pointer back to a libharu function, libharu only gets the lower 32 bits, the upper
bits being random.

And some suspicous warnings like:

hpdf_objects.c:55:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
                     (HPDF_UINT)obj, (HPDF_UINT)(header->obj_id),


So - should this work? Did anybody else  have this problem and found a solution?

Using master branch of https://github.com/libharu/libharu.git

There seem to be many forks - how can I get an overview about those?  (not knowing github that well)

wolfgang61

unread,
Jan 23, 2017, 10:36:05 AM1/23/17
to libHaru
To answer my own question:

No, it is not yet supported. It seems nobody ever used this in a 64bit environment.

In this snipped from hpdf.py

#HPDF_STATUS HPDF_SetCompressionMode (HPDF_Doc pdf, HPDF_UINT mode)
HPDF_SetCompressionMode=haru.HPDF_SetCompressionMode
HPDF_SetCompressionMode.argtypes = [HPDF_Doc, HPDF_UINT]
HPDF_SetCompressionMode.restype=HPDF_STATUS

I had to add the argtypes. It seems default are 32bit integers.

No function signature at all has argtypes defined yet.

But I need this, so I will do that.

Keeping the result for myself until a new maintainer is found, I do not want to add yet another fork.


Reply all
Reply to author
Forward
0 new messages