Skip to content

Commit afbd65d

Browse files
committed
Define PY_SSIZE_T_CLEAN for Python 3.10
On Python 3.10, `PY_SSIZE_T_CLEAN` must be defined in order to use '#' formats. `ioctl_func` needs a slight change to comply with the new regime. (Several functions pass `size_t` here, which may be a little dodgy, but the main point of this change seems to have been to transition from `int` to `Py_ssize_t`, and at least `size_t` and `Py_ssize_t` have the same size.) Closes #41.
1 parent a11cb33 commit afbd65d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fuseparts/_fusemodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define FUSE_USE_VERSION 26
2626
#endif
2727

28+
#define PY_SSIZE_T_CLEAN
2829
#include <Python.h>
2930
#include <fuse.h>
3031
#include <sys/ioctl.h>
@@ -1186,7 +1187,7 @@ ioctl_func(const char *path, int cmd, void *arg,
11861187
{
11871188
char* s;
11881189
char* input_data;
1189-
int input_data_size, output_data_size;
1190+
Py_ssize_t input_data_size, output_data_size;
11901191

11911192
input_data = (char*) data;
11921193
input_data_size = _IOC_SIZE(cmd);

0 commit comments

Comments
 (0)