summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/smb.h6
-rw-r--r--source3/locking/locking.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 5aa06347f8..e0f2e8483c 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -869,6 +869,12 @@ struct byte_range_lock {
enum brl_flavour lock_flav, \
br_off start, br_off size)
+#define LOCKING_FN_CAST() \
+ void (*)(struct share_mode_entry *, const char *, const char *)
+
+#define LOCKING_FN(fn) \
+ void (*fn)(struct share_mode_entry *, const char *, const char *)
+
struct bitmap {
uint32 *b;
unsigned int n;
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 01f12bbb58..9d3ca95601 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -1274,7 +1274,7 @@ static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf,
const char *sharepath;
const char *fname;
int i;
- void (*traverse_callback)(struct share_mode_entry *, const char *, const char *) = state;
+ LOCKING_FN(traverse_callback) = (LOCKING_FN_CAST())state;
/* Ensure this is a locking_key record. */
if (kbuf.dsize != sizeof(struct locking_key))