diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-05-18 09:56:01 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-05-18 09:56:01 +0200 |
commit | df8d092c3a3c65bc23bc3c1da281cc4cb10a1e3d (patch) | |
tree | ea5daefc9c1665ab14aeeedc0de4298c7c85a8b1 /compilerplugins/clang/checkconfigmacros.cxx | |
parent | tdf#99589 tolower / toupper - dangerous to Turks ... (diff) | |
download | core-df8d092c3a3c65bc23bc3c1da281cc4cb10a1e3d.tar.gz core-df8d092c3a3c65bc23bc3c1da281cc4cb10a1e3d.zip |
Adapt pathname checks to mixed usage of \ and / on Windows
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
Diffstat (limited to 'compilerplugins/clang/checkconfigmacros.cxx')
-rw-r--r-- | compilerplugins/clang/checkconfigmacros.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compilerplugins/clang/checkconfigmacros.cxx b/compilerplugins/clang/checkconfigmacros.cxx index d35008c70c20..d42adb08cc67 100644 --- a/compilerplugins/clang/checkconfigmacros.cxx +++ b/compilerplugins/clang/checkconfigmacros.cxx @@ -67,8 +67,8 @@ void CheckConfigMacros::MacroDefined( const Token& macroToken, const MacroDirect SourceLocation location = info->getLocation(); const char* filename = compiler.getSourceManager().getPresumedLoc( location ).getFilename(); if( filename != NULL - && ( strncmp( filename, BUILDDIR "/config_host/", strlen( BUILDDIR "/config_host/" )) == 0 - || strncmp( filename, BUILDDIR "/config_build/", strlen( BUILDDIR "/config_build/" )) == 0 )) + && ( hasPathnamePrefix(filename, BUILDDIR "/config_host/") + || hasPathnamePrefix(filename, BUILDDIR "/config_build/") )) { // fprintf(stderr,"DEF: %s %s\n", macroToken.getIdentifierInfo()->getName().data(), filename ); configMacros.insert( macroToken.getIdentifierInfo()->getName()); @@ -105,7 +105,7 @@ void CheckConfigMacros::checkMacro( const Token& macroToken, SourceLocation loca { const char* filename = compiler.getSourceManager().getPresumedLoc( location ).getFilename(); if( filename == NULL - || strncmp( filename, SRCDIR "/include/LibreOfficeKit/", strlen( SRCDIR "/include/LibreOfficeKit/" )) != 0 ) + || !hasPathnamePrefix(filename, SRCDIR "/include/LibreOfficeKit/") ) { report( DiagnosticsEngine::Error, "checking whether a config macro %0 is defined", location ) << macroToken.getIdentifierInfo()->getName(); |