Skip to content

Commit

Permalink
Fixed a compilation error where macro definitions could not be found (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexStocks authored Sep 21, 2024
2 parents ff31360 + d9e9469 commit 4e4058f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
7 changes: 1 addition & 6 deletions src/kiwi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,8 @@ bool KiwiDB::ParseArgs(int argc, char* argv[]) {
std::cerr << "kiwi Server version: " << Kkiwi_VERSION << " bits=" << (sizeof(void*) == 8 ? 64 : 32)
<< std::endl;
std::cerr << "kiwi Server Build Type: " << Kkiwi_BUILD_TYPE << std::endl;
#if defined(Kkiwi_BUILD_DATE)
std::cerr << "kiwi Server Build Date: " << Kkiwi_BUILD_DATE << std::endl;
#endif
#if defined(Kkiwi_GIT_COMMIT_ID)
std::cerr << "kiwi Server Build GIT SHA: " << Kkiwi_GIT_COMMIT_ID << std::endl;
#endif

std::exit(0);
break;
}
Expand Down Expand Up @@ -201,7 +196,7 @@ bool KiwiDB::Init() {
PREPL.SetMasterAddr(g_config.master_ip.ToString().c_str(), g_config.master_port.load());
}

event_server_ =std::make_unique<net::EventServer<std::shared_ptr<PClient>>>(num);
event_server_ = std::make_unique<net::EventServer<std::shared_ptr<PClient>>>(num);

event_server_->SetRwSeparation(true);

Expand Down
12 changes: 9 additions & 3 deletions src/kiwi.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
# define Kkiwi_BUILD_TYPE "RELEASE"
#endif

#ifndef Kkiwi_GIT_COMMIT_ID
# define Kkiwi_GIT_COMMIT_ID "unknown"
#endif

#ifndef Kkiwi_BUILD_DATE
# define Kkiwi_BUILD_DATE "unknown"
#endif

namespace kiwi {
class PRaft;
} // namespace kiwi
Expand Down Expand Up @@ -58,9 +66,7 @@ class KiwiDB final {
event_server_->SendPacket(client, std::move(msg));
}

inline void CloseConnection(const std::shared_ptr<kiwi::PClient>& client) {
event_server_->CloseConnection(client);
}
inline void CloseConnection(const std::shared_ptr<kiwi::PClient>& client) { event_server_->CloseConnection(client); }

void TCPConnect(
const net::SocketAddr& addr,
Expand Down

0 comments on commit 4e4058f

Please sign in to comment.