uint32_t mcs_key_hash(mcs_st *ptr, const char *key, size_t key_length, int *vbucket) { if (ptr->kind == MCS_KIND_LIBVBUCKET) { return lvb_key_hash(ptr, key, key_length, vbucket); } if (ptr->kind == MCS_KIND_LIBMEMCACHED) { return lmc_key_hash(ptr, key, key_length, vbucket); } return 0; }
uint32_t mcs_key_hash(mcs_st *ptr, const char *key, size_t key_length, int *vbucket) { #ifdef MOXI_USE_LIBVBUCKET if (ptr->kind == MCS_KIND_LIBVBUCKET) { return lvb_key_hash(ptr, key, key_length, vbucket); } #endif #ifdef MOXI_USE_LIBMEMCACHED if (ptr->kind == MCS_KIND_LIBMEMCACHED) { return lmc_key_hash(ptr, key, key_length, vbucket); } #endif return 0; }