Build: Changes required to compile and run using VS 2019 (#2975)

in vs 2019, the system xhash used by unordered_map uses Target in its template definition. pcsx2 #defines this in the r5900 and r3000 headers which leak cause a cryptic compilation error. A quick fix here is just to undef it in gamebase.h. A better fix would be to encapsulate the definition or use something more c++ to avoid the pre-processor. Add a comment to explain the _Target_ undef.

tap.h did not have string defined. I guess this was included transitively somewhere with an earlier set of system headers.

Biostools, the file is opened in text mode which causes the bios to be partially read. I'm not sure that's vs2019 specific but it's wrong in any case. Maybe the default mode parameter changed at some point. Maybe wxFile would be a better choice here rather than WxFFile because wxFile always open s in binary mode.
This commit is contained in:
Ian Brown 2019-06-01 12:34:21 +01:00 committed by lightningterror
parent 1f1b68a9b4
commit a1a6374709
3 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,11 @@
//#include "Common.h"
#include "AppConfig.h"
// _Target_ is defined by R300A.h and R5900.h and the definition leaks to here.
// The problem, at least with Visual Studio 2019 on Windows,
// is that unordered_map includes xhash which uses _Target_ as a template
// parameter. Unless we undef it here, the build breaks with a cryptic error message.
#undef _Target_
#include <unordered_map>
#include <wx/wfstream.h>

View File

@ -281,7 +281,7 @@ void LoadBIOS()
BiosChecksum = 0;
wxString biosZone;
wxFFile fp( Bios );
wxFFile fp( Bios , "rb");
fp.Read( eeMem->ROM, std::min<s64>( Ps2MemSize::Rom, filesize ) );
ChecksumIt( BiosChecksum, eeMem->ROM );

View File

@ -15,6 +15,7 @@
#pragma once
#include <vector>
#include <string>
#include "..\net.h"
using namespace std;