From 743854127a5f57ef9495723373a4faaf276b2d54 Mon Sep 17 00:00:00 2001 From: l0calh05t Date: Wed, 7 Oct 2015 15:46:30 +0200 Subject: fixes #11 (fix for different paths on older VS versions on amd64) --- src/mspdb.cpp | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/mspdb.cpp b/src/mspdb.cpp index 37e9c55..bde236d 100644 --- a/src/mspdb.cpp +++ b/src/mspdb.cpp @@ -73,28 +73,33 @@ bool tryLoadMsPdb(const char* version, const char* mspdb, const char* path = 0) *p++ = '\\'; if(path) p += strlen(strcpy(p, path)); -#ifdef _M_X64 - p += strlen(strcpy(p, "amd64\\")); -#endif strcpy(p, mspdb); tryLoadLibrary(installDir); return modMsPdb != 0; } +#ifdef _M_X64 +#define MSPDB_DIR_NEW "..\\..\\VC\\bin\\amd64\\" +#define MSPDB_DIR_OLD MSPDB_DIR_NEW +#else +#define MSPDB_DIR_NEW "..\\..\\VC\\bin\\" +#define MSPDB_DIR_OLD 0 +#endif + void tryLoadMsPdb80(bool throughPath) { if (!modMsPdb && throughPath) tryLoadLibrary(mspdb80_dll); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VisualStudio\\9.0", mspdb80_dll); + tryLoadMsPdb("VisualStudio\\9.0", mspdb80_dll, MSPDB_DIR_OLD); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VisualStudio\\8.0", mspdb80_dll); + tryLoadMsPdb("VisualStudio\\8.0", mspdb80_dll, MSPDB_DIR_OLD); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VCExpress\\9.0", mspdb80_dll); + tryLoadMsPdb("VCExpress\\9.0", mspdb80_dll, MSPDB_DIR_OLD); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VCExpress\\8.0", mspdb80_dll); + tryLoadMsPdb("VCExpress\\8.0", mspdb80_dll, MSPDB_DIR_OLD); } void tryLoadMsPdb100(bool throughPath) @@ -104,9 +109,9 @@ void tryLoadMsPdb100(bool throughPath) if(throughPath) modMsPdb = LoadLibraryA(mspdb100_dll); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VisualStudio\\10.0", mspdb100_dll); + tryLoadMsPdb("VisualStudio\\10.0", mspdb100_dll, MSPDB_DIR_OLD); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VCExpress\\10.0", mspdb100_dll); + tryLoadMsPdb("VCExpress\\10.0", mspdb100_dll, MSPDB_DIR_OLD); if (modMsPdb) mspdb::vsVersion = 10; } @@ -119,9 +124,9 @@ void tryLoadMsPdb110(bool throughPath) if (throughPath) modMsPdb = LoadLibraryA(mspdb110_dll); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VisualStudio\\11.0", mspdb110_dll); + tryLoadMsPdb("VisualStudio\\11.0", mspdb110_dll, MSPDB_DIR_OLD); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VSWinExpress\\11.0", mspdb110_dll); + tryLoadMsPdb("VSWinExpress\\11.0", mspdb110_dll, MSPDB_DIR_OLD); if (modMsPdb) mspdb::vsVersion = 11; } @@ -134,9 +139,9 @@ void tryLoadMsPdb120(bool throughPath) if(throughPath) modMsPdb = LoadLibraryA(mspdb120_dll); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VisualStudio\\12.0", mspdb120_dll, "..\\..\\VC\\bin\\"); + tryLoadMsPdb("VisualStudio\\12.0", mspdb120_dll, MSPDB_DIR_NEW); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VSWinExpress\\12.0", mspdb120_dll, "..\\..\\VC\\bin\\"); + tryLoadMsPdb("VSWinExpress\\12.0", mspdb120_dll, MSPDB_DIR_NEW); if (modMsPdb) mspdb::vsVersion = 12; } @@ -149,9 +154,9 @@ void tryLoadMsPdb140(bool throughPath) if(throughPath) modMsPdb = LoadLibraryA(mspdb140_dll); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VisualStudio\\14.0", mspdb140_dll, "..\\..\\VC\\bin\\"); + tryLoadMsPdb("VisualStudio\\14.0", mspdb140_dll, MSPDB_DIR_NEW); if (!modMsPdb && !throughPath) - tryLoadMsPdb("VSWinExpress\\14.0", mspdb140_dll, "..\\..\\VC\\bin\\"); + tryLoadMsPdb("VSWinExpress\\14.0", mspdb140_dll, MSPDB_DIR_NEW); if (modMsPdb) mspdb::vsVersion = 14; } -- cgit v0.12