Kaydet (Commit) a8f357cf authored tarafından Michael Stahl's avatar Michael Stahl

concat-deps: on Windows, compare paths case-insensitively

Change-Id: I5e5d9b39cb0440644bf3ffb8dca4913dc123f672
üst eb94d42d
...@@ -97,9 +97,11 @@ ...@@ -97,9 +97,11 @@
#ifdef __windows #ifdef __windows
#define FILE_O_RDONLY _O_RDONLY #define FILE_O_RDONLY _O_RDONLY
#define FILE_O_BINARY _O_BINARY #define FILE_O_BINARY _O_BINARY
#define PATHNCMP strncasecmp /* MSVC converts paths to lower-case sometimes? */
#else /* not windaube */ #else /* not windaube */
#define FILE_O_RDONLY O_RDONLY #define FILE_O_RDONLY O_RDONLY
#define FILE_O_BINARY 0 #define FILE_O_BINARY 0
#define PATHNCMP strncmp
#endif /* not windaube */ #endif /* not windaube */
#ifndef TRUE #ifndef TRUE
...@@ -730,7 +732,7 @@ elide_dependency(const char* key, int key_len, ...@@ -730,7 +732,7 @@ elide_dependency(const char* key, int key_len,
#endif #endif
/* .hdl files are always matched by .hpp */ /* .hdl files are always matched by .hpp */
if (key_len > 4 && !strncmp(key + key_len - 4, ".hdl", 4)) if (key_len > 4 && !PATHNCMP(key + key_len - 4, ".hdl", 4))
return 1; return 1;
/* boost brings a plague of header files */ /* boost brings a plague of header files */
...@@ -746,13 +748,13 @@ elide_dependency(const char* key, int key_len, ...@@ -746,13 +748,13 @@ elide_dependency(const char* key, int key_len,
{ {
if (0 == boost) if (0 == boost)
{ {
if (!strncmp(key + i + 1, "solver/", 7)) if (!PATHNCMP(key + i + 1, "solver/", 7))
{ {
boost++; boost++;
continue; continue;
} }
} }
else if (!strncmp(key + i + 1, "inc/external/boost/", 19)) else if (!PATHNCMP(key + i + 1, "inc/external/boost/", 19))
{ {
if (boost_count) if (boost_count)
(*boost_count)++; (*boost_count)++;
...@@ -761,7 +763,7 @@ elide_dependency(const char* key, int key_len, ...@@ -761,7 +763,7 @@ elide_dependency(const char* key, int key_len,
} }
if (0 == unpacked) if (0 == unpacked)
{ {
if (!strncmp(key + i + 1, "workdir/", 8)) if (!PATHNCMP(key + i + 1, "workdir/", 8))
{ {
unpacked = 1; unpacked = 1;
continue; continue;
...@@ -769,7 +771,7 @@ elide_dependency(const char* key, int key_len, ...@@ -769,7 +771,7 @@ elide_dependency(const char* key, int key_len,
} }
else else
{ {
if (!strncmp(key + i + 1, "UnpackedTarball/", 16)) if (!PATHNCMP(key + i + 1, "UnpackedTarball/", 16))
{ {
if (unpacked_end) if (unpacked_end)
*unpacked_end = strchr(key + i + 17, '/'); *unpacked_end = strchr(key + i + 17, '/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment