diff options
-rw-r--r-- | ArchiveEx/Archive.cpp | 12 | ||||
-rw-r--r-- | ArchiveEx/dat.cpp | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/ArchiveEx/Archive.cpp b/ArchiveEx/Archive.cpp index a418446..c6e4e97 100644 --- a/ArchiveEx/Archive.cpp +++ b/ArchiveEx/Archive.cpp @@ -1,5 +1,11 @@ #include "Archive.h" +#ifdef _WIN32 +#include <string.h> +#else +#include <strings.h> +#endif + #include <cstdint> #include <cstdio> #include <cstring> @@ -125,7 +131,11 @@ Archive::Find(const char* filepath) const auto path = std::make_unique<char[]>(std::strlen(filepath) + 1); ConvertPathSeparator(filepath, path.get()); for (std::size_t i = 0; i < entries.size(); ++i) { - if (0 == std::strcmp(entries[i].name, path.get())) +#ifdef _WIN32 + if (0 == _stricmp(entries[i].name, path.get())) +#else + if (0 == strcasecmp(entries[i].name, path.get())) +#endif return i; } return -1; diff --git a/ArchiveEx/dat.cpp b/ArchiveEx/dat.cpp index 6df04bc..ceeaa9e 100644 --- a/ArchiveEx/dat.cpp +++ b/ArchiveEx/dat.cpp @@ -1,4 +1,4 @@ -#ifdef WIN32 +#ifdef _WIN32 #include <shlwapi.h> #else #include <fnmatch.h> @@ -179,7 +179,7 @@ FilterFile(const std::vector<std::string>& patterns, std::function<void(const ch if (patterns.empty()) return func(name); for (const auto& pattern : patterns) { -#ifdef WIN32 +#ifdef _WIN32 if (PathMatchSpecA(name, pattern.c_str())) #else if (0 == fnmatch(pattern.c_str(), name, FNM_PATHNAME | FNM_LEADING_DIR)) |