Skip to content

Commit d1bc769

Browse files
authored
Merge pull request ceph#64176 from tchaikov/wip-pybind-cb-types
pybind: fix callback function type compatibility for GCC 14/15 Reviewed-by: Samuel Just <[email protected]> Reviewed-by: Nitzan Mordhai <[email protected]>
2 parents cb92ff2 + a2e52d3 commit d1bc769

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/pybind/rados/mock_rados.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ cdef nogil:
449449
pass
450450
void rados_read_op_set_flags(rados_read_op_t read_op, int flags):
451451
pass
452-
int rados_omap_get_next(rados_omap_iter_t iter, const char * const* key, const char * const* val, size_t * len):
452+
int rados_omap_get_next(rados_omap_iter_t iter, char ** key, char ** val, size_t * len):
453453
pass
454454
void rados_omap_get_end(rados_omap_iter_t iter):
455455
pass

src/pybind/rgw/c_rgw.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ cdef extern from "rados/rgw_file.h" nogil:
102102

103103
int rgw_readdir(rgw_fs *fs,
104104
rgw_file_handle *parent_fh, uint64_t *offset,
105-
bool (*cb)(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) nogil except? -9000,
105+
int (*cb)(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) nogil except? -9000,
106106
void *cb_arg, bool *eof, uint32_t flags) except? -9000
107107

108108
int rgw_getattr(rgw_fs *fs,

src/pybind/rgw/mock_rgw.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ cdef nogil:
116116

117117
int rgw_readdir(rgw_fs *fs,
118118
rgw_file_handle *parent_fh, uint64_t *offset,
119-
libcpp.bool (*cb)(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) nogil except? -9000,
119+
int (*cb)(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) nogil except? -9000,
120120
void *cb_arg, libcpp.bool *eof, uint32_t flags) except? -9000:
121121
pass
122122

src/pybind/rgw/rgw.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ cdef make_ex(ret, msg):
166166
return Error(msg + (": error code %d" % ret))
167167

168168

169-
cdef bint readdir_cb(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) \
169+
cdef int readdir_cb(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) \
170170
except? -9000 with gil:
171171
if exc.PyErr_Occurred():
172-
return False
172+
return 0
173173
(<object>arg)(name, offset, flags)
174-
return True
174+
return 1
175175

176176

177177
class LibCephFSStateError(Error):

0 commit comments

Comments
 (0)