diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-05-16 10:24:09 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-05-16 10:24:09 (GMT) |
commit | a2133a44d353997af904299c73f267a94eb6f9b9 (patch) | |
tree | a3edfb5c7de3cb7b6202b1cb6a9b606e31e2d70a /src/util.cpp | |
parent | fe16aedd32137828fb0ab9cdd68ef043e17c59ee (diff) | |
download | Doxygen-a2133a44d353997af904299c73f267a94eb6f9b9.zip Doxygen-a2133a44d353997af904299c73f267a94eb6f9b9.tar.gz Doxygen-a2133a44d353997af904299c73f267a94eb6f9b9.tar.bz2 |
Reduce use of WIN32 defines outside of portable
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/util.cpp b/src/util.cpp index a595b06..5b799c8 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4524,11 +4524,9 @@ FileDef *findFileDef(const FileNameLinkedMap *fnMap,const char *n,bool &ambig) if (fn->size()==1) { const std::unique_ptr<FileDef> &fd = fn->front(); -#if defined(_WIN32) || defined(__MACOSX__) || defined(__CYGWIN__) // Windows or MacOSX - bool isSamePath = fd->getPath().right(path.length()).lower()==path.lower(); -#else // Unix - bool isSamePath = fd->getPath().right(path.length())==path; -#endif + bool isSamePath = Portable::fileSystemIsCaseSensitive() ? + fd->getPath().right(path.length())==path : + fd->getPath().right(path.length()).lower()==path.lower(); if (path.isEmpty() || isSamePath) { cachedResult->fileDef = fd.get(); @@ -7331,22 +7329,14 @@ void stackTrace() p += sprintf(p,"%p ", backtraceFrames[x]); } fprintf(stderr,"========== STACKTRACE START ==============\n"); - #if defined(_WIN32) && !defined(__CYGWIN__) - if (FILE *fp = _popen(cmd, "r")) - #else - if (FILE *fp = ::popen(cmd, "r")) - #endif + if (FILE *fp = Portable::popen(cmd, "r")) { char resBuf[512]; while (size_t len = fread(resBuf, 1, sizeof(resBuf), fp)) { fwrite(resBuf, 1, len, stderr); } - #if defined(_WIN32) && !defined(__CYGWIN__) - _pclose(fp); - #else - ::pclose(fp); - #endif + Portable::pclose(fp); } fprintf(stderr,"============ STACKTRACE END ==============\n"); //fprintf(stderr,"%s\n", frameStrings[x]); @@ -7510,10 +7500,11 @@ bool patternMatch(const QFileInfo &fi,const QStrList *patList) static bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES); bool found = FALSE; - // For Windows/Mac, always do the case insensitive match -#if defined(_WIN32) || defined(__MACOSX__) || defined(__CYGWIN__) - caseSenseNames = FALSE; -#endif + // For platforms where the file system is non case sensitive overrule the setting + if (!Portable::fileSystemIsCaseSensitive()) + { + caseSenseNames = FALSE; + } if (patList) { |