mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Workaround for uclibc missing map::operator==()
This commit is contained in:
parent
547b1c6157
commit
88949a750f
1 changed files with 16 additions and 1 deletions
|
@ -33,7 +33,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "Constants.hpp"
|
#include "Constants.hpp"
|
||||||
#include "Utils.hpp"
|
#include "Utils.hpp"
|
||||||
|
|
||||||
|
@ -305,6 +305,21 @@ public:
|
||||||
*/
|
*/
|
||||||
bool verify(const Identity &id) const;
|
bool verify(const Identity &id) const;
|
||||||
|
|
||||||
|
inline bool operator==(const Dictionary &d) const
|
||||||
|
{
|
||||||
|
// std::map::operator== is broken on uclibc++
|
||||||
|
if (size() != d.size())
|
||||||
|
return false;
|
||||||
|
const_iterator a(begin());
|
||||||
|
const_iterator b(d.begin());
|
||||||
|
while (a != end()) {
|
||||||
|
if (*(a++) != *(b++))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
inline bool operator!=(const Dictionary &d) const { return (!(*this == d)); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _mkSigBuf(std::string &buf) const;
|
void _mkSigBuf(std::string &buf) const;
|
||||||
static void _appendEsc(const char *data,unsigned int len,std::string &to);
|
static void _appendEsc(const char *data,unsigned int len,std::string &to);
|
||||||
|
|
Loading…
Add table
Reference in a new issue