Skip to content

Windows build fix: strncasecmp is a POSIX call #59

@DennisOSRM

Description

@DennisOSRM

Windows is as always a treat. This time, the str(n)casecmp are available under a different name only. The following diff fixes compilation.

diff --git a/third_party/osmium/util/config.hpp b/third_party/osmium/util/config.hpp
index c30f02e..6c86d68 100644
--- a/third_party/osmium/util/config.hpp
+++ b/third_party/osmium/util/config.hpp
@@ -36,6 +36,11 @@ DEALINGS IN THE SOFTWARE.
 #include <cstdlib>
 #include <cstring>

+#ifdef _MSC_VER 
+#define strncasecmp _strnicmp
+#define strcasecmp _stricmp
+#endif
+
 namespace osmium {

     namespace config {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions