Portability: Raise an error if a platform-specific filename compare function is not specified
This commit is contained in:
parent
6abf29bd22
commit
f0468952f8
11
lib/path.cpp
11
lib/path.cpp
|
@ -110,15 +110,14 @@ bool Path::sameFileName(const std::string &fname1, const std::string &fname2)
|
||||||
{
|
{
|
||||||
#if defined(__linux__) || defined(__sun)
|
#if defined(__linux__) || defined(__sun)
|
||||||
return bool(fname1 == fname2);
|
return bool(fname1 == fname2);
|
||||||
#endif
|
#elif defined(__GNUC__)
|
||||||
#ifdef __GNUC__
|
|
||||||
return bool(strcasecmp(fname1.c_str(), fname2.c_str()) == 0);
|
return bool(strcasecmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||||
#endif
|
#elif defined(__BORLANDC__)
|
||||||
#ifdef __BORLANDC__
|
|
||||||
return bool(stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
return bool(stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||||
#endif
|
#elif defined(_MSC_VER)
|
||||||
#ifdef _MSC_VER
|
|
||||||
return bool(_stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
return bool(_stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||||
|
#else
|
||||||
|
#error Platform filename compare function needed
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue