Merge pull request #222 from rpavlik/fixmxe

Fix (cli) build on MXE
This commit is contained in:
Daniel Marjamäki 2014-01-17 23:47:42 -08:00
commit 81572135f4
3 changed files with 9 additions and 2 deletions

View File

@ -530,3 +530,6 @@ test/testunusedvar.o: test/testunusedvar.cpp test/testsuite.h lib/errorlogger.h
test/testvalueflow.o: test/testvalueflow.cpp test/testsuite.h lib/errorlogger.h lib/config.h lib/suppressions.h test/redirect.h lib/library.h lib/path.h lib/mathlib.h test/testutils.h lib/settings.h lib/standards.h lib/timer.h lib/tokenize.h lib/tokenlist.h lib/valueflow.h lib/token.h
$(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CFG) $(CXXFLAGS) -std=c++0x -c -o test/testvalueflow.o test/testvalueflow.cpp
externals/tinyxml/tinyxml2.o: externals/tinyxml/tinyxml2.cpp externals/tinyxml/tinyxml2.h
$(CXX) ${INCLUDE_FOR_LIB} $(CPPFLAGS) $(CFG) $(CXXFLAGS) -std=c++0x -c -o externals/tinyxml/tinyxml2.o externals/tinyxml/tinyxml2.cpp

View File

@ -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

View File

@ -388,6 +388,7 @@ int main(int argc, char **argv)
compilefiles(fout, libfiles, "${INCLUDE_FOR_LIB}");
compilefiles(fout, clifiles, "${INCLUDE_FOR_CLI}");
compilefiles(fout, testfiles, "${INCLUDE_FOR_TEST}");
compilefiles(fout, externalfiles, "${INCLUDE_FOR_LIB}");
return 0;
}