Skip to content

Commit 379a506

Browse files
committed
Fix #123: Rename macro-generated functions to avoid potential name clash
1 parent bf1f753 commit 379a506

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/macros.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ macro_rules! redis_command {
1111
let flags = CString::new($command_flags).unwrap();
1212

1313
/////////////////////
14-
extern "C" fn do_command(
14+
extern "C" fn __do_command(
1515
ctx: *mut $crate::raw::RedisModuleCtx,
1616
argv: *mut *mut $crate::raw::RedisModuleString,
1717
argc: c_int,
@@ -30,7 +30,7 @@ macro_rules! redis_command {
3030
$crate::raw::RedisModule_CreateCommand.unwrap()(
3131
$ctx,
3232
name.as_ptr(),
33-
Some(do_command),
33+
Some(__do_command),
3434
flags.as_ptr(),
3535
$firstkey,
3636
$lastkey,
@@ -51,7 +51,7 @@ macro_rules! redis_event_handler {
5151
$event_type: expr,
5252
$event_handler: expr
5353
) => {{
54-
extern "C" fn handle_event(
54+
extern "C" fn __handle_event(
5555
ctx: *mut $crate::raw::RedisModuleCtx,
5656
event_type: c_int,
5757
event: *const c_char,
@@ -75,7 +75,7 @@ macro_rules! redis_event_handler {
7575
$crate::raw::RedisModule_SubscribeToKeyspaceEvents.unwrap()(
7676
$ctx,
7777
$event_type.bits(),
78-
Some(handle_event),
78+
Some(__handle_event),
7979
)
8080
} == $crate::raw::Status::Err as c_int
8181
{

0 commit comments

Comments
 (0)