Fix case-insensitive string compare function on MinGW
This commit is contained in:
parent
bc79f7905a
commit
32bf275447
|
@ -16,6 +16,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && defined(_WIN32)
|
||||
#undef __STRICT_ANSI__
|
||||
#endif
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
@ -121,12 +124,12 @@ bool Path::sameFileName(const std::string &fname1, const std::string &fname2)
|
|||
{
|
||||
#if defined(__linux__) || defined(__sun) || defined(__hpux)
|
||||
return bool(fname1 == fname2);
|
||||
#elif defined(_MSC_VER) || (defined(__GNUC__) && defined(_WIN32))
|
||||
return bool(_stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||
#elif defined(__GNUC__)
|
||||
return bool(strcasecmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||
#elif defined(__BORLANDC__)
|
||||
return bool(stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||
#elif defined(_MSC_VER)
|
||||
return bool(_stricmp(fname1.c_str(), fname2.c_str()) == 0);
|
||||
#else
|
||||
#error Platform filename compare function needed
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue