diff --git a/src/HttpServer.cc b/src/HttpServer.cc index fc799962..02279ad1 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -260,7 +260,12 @@ public: return &ent; } FileEntry *cache_fd(const std::string &path, const FileEntry &ent) { +#ifdef HAVE_STD_MAP_EMPLACE auto rv = fd_cache_.emplace(path, ent); +#else // !HAVE_STD_MAP_EMPLACE + // for gcc-4.7 + auto rv = fd_cache_.insert(std::make_pair(path, ent)); +#endif // !HAVE_STD_MAP_EMPLACE return &(*rv.first).second; } void release_fd(const std::string &path) { diff --git a/src/shrpx_downstream_queue.cc b/src/shrpx_downstream_queue.cc index 32ff4e68..c70eb064 100644 --- a/src/shrpx_downstream_queue.cc +++ b/src/shrpx_downstream_queue.cc @@ -64,7 +64,8 @@ DownstreamQueue::find_host_entry(const std::string &host) { std::tie(itr, std::ignore) = host_entries_.emplace(host, HostEntry()); #else // !HAVE_STD_MAP_EMPLACE // for g++-4.7 - std::tie(itr, std::ignore) = host_entries_.insert({host, HostEntry()}); + std::tie(itr, std::ignore) = + host_entries_.insert(std::make_pair(host, HostEntry())); #endif // !HAVE_STD_MAP_EMPLACE } return (*itr).second;