diff --git a/src/input/ReaderBackend.h b/src/input/ReaderBackend.h index 7626cc25ed..8ee14c808a 100644 --- a/src/input/ReaderBackend.h +++ b/src/input/ReaderBackend.h @@ -74,7 +74,7 @@ public: struct ReaderInfo { // Structure takes ownership of the strings. - typedef std::map config_map; + typedef std::map config_map; /** * A string left to the interpretation of the reader diff --git a/src/logging/WriterBackend.h b/src/logging/WriterBackend.h index 1ca5650057..d5f2be225e 100644 --- a/src/logging/WriterBackend.h +++ b/src/logging/WriterBackend.h @@ -49,7 +49,7 @@ public: struct WriterInfo { // Structure takes ownership of these strings. - typedef std::map config_map; + typedef std::map config_map; /** * A string left to the interpretation of the writer diff --git a/src/util.h b/src/util.h index a695c6df6a..030a704092 100644 --- a/src/util.h +++ b/src/util.h @@ -345,4 +345,15 @@ inline int safe_vsnprintf(char* str, size_t size, const char* format, va_list al extern void get_memory_usage(unsigned int* total, unsigned int* malloced); +// class to be used as a third argument for stl maps to be able to use +// char*'s as keys. Otherwise the pointer values will be compared instead +// of the actual string values. +struct CompareString + { + bool operator()(char const *a, char const *b) const + { + return std::strcmp(a, b) < 0; + } + }; + #endif