Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
More solaris build fixes.
Browse files Browse the repository at this point in the history
Error: Could not find a match for std::multimap<...>::insert(std::pair<...,...>)
Compiler: Sun C++ 5.9
Cause: the multimap classes don't have a method insert(pair<First, Second>), only insert(pair<const First, Second>).
Solution: Instead of insert(make_pair(first, second)), use insert(mm::value_type(first, second)).
  • Loading branch information
tmm1 committed Mar 8, 2009
1 parent c100082 commit f5b04cd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 16 additions & 0 deletions ext/cplusplus.cpp
Expand Up @@ -49,7 +49,11 @@ void EM::AddTimer (int milliseconds, void (*func)())
{
if (func) {
const char *sig = evma_install_oneshot_timer (milliseconds);
#ifdef OS_SOLARIS8
Timers.insert (map<string, void(*)()>::value_type (sig, func));
#else
Timers.insert (make_pair (sig, func));
#endif
}
}

Expand All @@ -72,7 +76,11 @@ void EM::Acceptor::Accept (const char *signature)
{
Connection *c = MakeConnection();
c->Signature = signature;
#ifdef OS_SOLARIS8
Eventables.insert (std::map<std::string,EM::Eventable*>::value_type (c->Signature, c));
#else
Eventables.insert (make_pair (c->Signature, c));
#endif
c->PostInit();
}

Expand Down Expand Up @@ -114,7 +122,11 @@ EM::Connection::Connect
void EM::Connection::Connect (const char *host, int port)
{
Signature = evma_connect_to_server (host, port);
#ifdef OS_SOLARIS8
Eventables.insert( std::map<std::string,EM::Eventable*>::value_type (Signature, this));
#else
Eventables.insert( make_pair (Signature, this));
#endif
}

/*******************
Expand All @@ -124,7 +136,11 @@ EM::Acceptor::Start
void EM::Acceptor::Start (const char *host, int port)
{
Signature = evma_create_tcp_server (host, port);
#ifdef OS_SOLARIS8
Eventables.insert( std::map<std::string,EM::Eventable*>::value_type (Signature, this));
#else
Eventables.insert( make_pair (Signature, this));
#endif
}


Expand Down
7 changes: 5 additions & 2 deletions ext/em.cpp
Expand Up @@ -933,8 +933,11 @@ const char *EventMachine_t::InstallOneshotTimer (int milliseconds)
#endif

Timer_t t;
multimap<Int64,Timer_t>::iterator i =
Timers.insert (make_pair (fire_at, t));
#ifdef OS_SOLARIS8
multimap<Int64,Timer_t>::iterator i = Timers.insert (multimap<Int64,Timer_t>::value_type (fire_at, t));
#else
multimap<Int64,Timer_t>::iterator i = Timers.insert (make_pair (fire_at, t));
#endif
return i->second.GetBindingChars();
}

Expand Down

0 comments on commit f5b04cd

Please sign in to comment.