Skip to content

Commit c5bd818

Browse files
author
dzsekijo
committed
use the dedicated size_t value builder if Python supports it (version >= 2.5.0)
1 parent 1293a13 commit c5bd818

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

fuseparts/_fusemodule.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,11 @@ static int
482482
read_func(const char *path, char *buf, size_t s, off_t off)
483483
#endif
484484
{
485+
#if PY_VERSION_HEX < 0x02050000
485486
PROLOGUE( PYO_CALLWITHFI(fi, read_cb, siK, path, s, off) )
487+
#else
488+
PROLOGUE( PYO_CALLWITHFI(fi, read_cb, snK, path, s, off) )
489+
#endif
486490

487491
if(PyString_Check(v)) {
488492
if(PyString_Size(v) > s)
@@ -665,7 +669,11 @@ flush_func(const char *path)
665669
static int
666670
getxattr_func(const char *path, const char *name, char *value, size_t size)
667671
{
672+
#if PY_VERSION_HEX < 0x02050000
668673
PROLOGUE( PyObject_CallFunction(getxattr_cb, "ssi", path, name, size) )
674+
#else
675+
PROLOGUE( PyObject_CallFunction(getxattr_cb, "ssn", path, name, size) )
676+
#endif
669677

670678
if(PyString_Check(v)) {
671679
if(PyString_Size(v) > size)
@@ -682,8 +690,11 @@ listxattr_func(const char *path, char *list, size_t size)
682690
{
683691
PyObject *iter, *w;
684692
char *lx = list;
693+
#if PY_VERSION_HEX < 0x02050000
685694
PROLOGUE( PyObject_CallFunction(listxattr_cb, "si", path, size) )
686-
695+
#else
696+
PROLOGUE( PyObject_CallFunction(listxattr_cb, "sn", path, size) )
697+
#endif
687698
iter = PyObject_GetIter(v);
688699
if(!iter) {
689700
PyErr_Print();

0 commit comments

Comments
 (0)