-
-
Notifications
You must be signed in to change notification settings - Fork 45
Description
I've inherited a project and I'm trying to compile and use it on Linux instead of MacOS.
There are several such declarations:
pub static ROLE_CHANGED_SERVER_EVENTS_LIST: [fn(&Context, ServerRole)] = [..];
Which are subsequently called thusly:
extern "C" fn role_changed_callback(
ctx: *mut raw::RedisModuleCtx,
_eid: raw::RedisModuleEvent,
subevent: u64,
_data: *mut ::std::os::raw::c_void,
) {
let new_role = if subevent == raw::REDISMODULE_EVENT_REPLROLECHANGED_NOW_MASTER {
ServerRole::Primary
} else {
ServerRole::Replica
};
let ctx = Context::new(ctx);
ROLE_CHANGED_SERVER_EVENTS_LIST.iter().for_each(|callback| {
callback(&ctx, new_role);
});
}
All of this works fine under MacOS, but when we try to load the module in Linux we receive an error that the following symbol is missing:
__start_linkme_ROLE_CHANGED_SERVER_EVENTS_LIST
Thanks