From f0468952f83ae3509b0f96205c00ba9c7c1e84d9 Mon Sep 17 00:00:00 2001 From: Greg Hewgill Date: Wed, 27 Apr 2011 21:08:10 +1200 Subject: [PATCH] Portability: Raise an error if a platform-specific filename compare function is not specified --- lib/path.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/path.cpp b/lib/path.cpp index 56458d3fb..9d45da382 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -110,15 +110,14 @@ bool Path::sameFileName(const std::string &fname1, const std::string &fname2) { #if defined(__linux__) || defined(__sun) return bool(fname1 == fname2); -#endif -#ifdef __GNUC__ +#elif defined(__GNUC__) return bool(strcasecmp(fname1.c_str(), fname2.c_str()) == 0); -#endif -#ifdef __BORLANDC__ +#elif defined(__BORLANDC__) return bool(stricmp(fname1.c_str(), fname2.c_str()) == 0); -#endif -#ifdef _MSC_VER +#elif defined(_MSC_VER) return bool(_stricmp(fname1.c_str(), fname2.c_str()) == 0); +#else + #error Platform filename compare function needed #endif }