[Project64] Fix up compile issues with me removing windows.h

This commit is contained in:
zilmar 2016-01-05 21:32:18 +11:00
parent 96712e6042
commit 2b31784057
13 changed files with 54 additions and 28 deletions

View File

@ -1,6 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010 or later
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rd Party", "3rd Party", "{AA8F7F8E-5377-4911-859D-8A8817B0DB26}"
EndProject
@ -63,6 +64,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "Source\3rdParty\sdl
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project64-core", "Source\Project64-core\Project64-core.vcxproj", "{00C7B43A-DED7-4DF0-B072-9A5783EF866D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RSP-hle", "Source\RSP-hle\RSP-hle.vcxproj", "{B6D45C01-0067-48E6-9FC3-29329D6A5ACA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -220,6 +223,12 @@ Global
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Release|Win32.Build.0 = Release|Win32
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Release|x64.ActiveCfg = Release|x64
{00C7B43A-DED7-4DF0-B072-9A5783EF866D}.Release|x64.Build.0 = Release|x64
{B6D45C01-0067-48E6-9FC3-29329D6A5ACA}.Debug|Win32.ActiveCfg = Debug|Win32
{B6D45C01-0067-48E6-9FC3-29329D6A5ACA}.Debug|Win32.Build.0 = Debug|Win32
{B6D45C01-0067-48E6-9FC3-29329D6A5ACA}.Debug|x64.ActiveCfg = Debug|Win32
{B6D45C01-0067-48E6-9FC3-29329D6A5ACA}.Release|Win32.ActiveCfg = Release|Win32
{B6D45C01-0067-48E6-9FC3-29329D6A5ACA}.Release|Win32.Build.0 = Release|Win32
{B6D45C01-0067-48E6-9FC3-29329D6A5ACA}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,4 +1,5 @@
#include "stdafx.h"
#include <windows.h>
CriticalSection::CriticalSection()
{

View File

@ -1,4 +1,5 @@
#include "stdafx.h"
#include <windows.h>
#include <TChar.H>

View File

@ -1,5 +1,5 @@
#include "stdafx.h"
#include <windows.h>
#include <TChar.H>
CIniFileBase::CIniFileBase(CFileBase & FileObject, LPCTSTR FileName) :

View File

@ -1,6 +1,8 @@
#include "stdafx.h"
#include <malloc.h>
#include <algorithm>
#include "StdString.h"
#include <windows.h>
stdstr::stdstr()
{
@ -131,7 +133,8 @@ stdstr & stdstr::TrimLeft(const char * chars2remove)
{
erase(0, pos);
}
else {
else
{
erase(begin(), end()); // make empty
}
}
@ -147,7 +150,8 @@ stdstr & stdstr::TrimRight(const char * chars2remove)
{
erase(pos + 1);
}
else {
else
{
erase(begin(), end()); // make empty
}
}
@ -181,6 +185,7 @@ stdstr & stdstr::Trim(const char * chars2remove)
return *this;
}
#ifdef _WIN32
stdstr & stdstr::FromUTF16(const wchar_t * UTF16Source, bool * bSuccess)
{
bool bConverted = false;
@ -192,7 +197,7 @@ stdstr & stdstr::FromUTF16(const wchar_t * UTF16Source, bool * bSuccess)
}
else if (wcslen(UTF16Source) > 0)
{
DWORD nNeeded = WideCharToMultiByte(CP_UTF8, 0, UTF16Source, -1, NULL, 0, NULL, NULL);
uint32_t nNeeded = WideCharToMultiByte(CODEPAGE_UTF8, 0, UTF16Source, -1, NULL, 0, NULL, NULL);
if (nNeeded > 0)
{
char * buf = (char *)alloca(nNeeded + 1);
@ -200,7 +205,7 @@ stdstr & stdstr::FromUTF16(const wchar_t * UTF16Source, bool * bSuccess)
{
memset(buf, 0, nNeeded + 1);
nNeeded = WideCharToMultiByte(CP_UTF8, 0, UTF16Source, -1, buf, nNeeded, NULL, NULL);
nNeeded = WideCharToMultiByte(CODEPAGE_UTF8, 0, UTF16Source, -1, buf, nNeeded, NULL, NULL);
if (nNeeded)
{
*this = buf;
@ -216,7 +221,7 @@ stdstr & stdstr::FromUTF16(const wchar_t * UTF16Source, bool * bSuccess)
return *this;
}
std::wstring stdstr::ToUTF16(UINT CodePage, bool * bSuccess)
std::wstring stdstr::ToUTF16(unsigned int CodePage, bool * bSuccess)
{
bool bConverted = false;
std::wstring res;
@ -243,3 +248,12 @@ std::wstring stdstr::ToUTF16(UINT CodePage, bool * bSuccess)
}
return res;
}
#endif
stdstr_f::stdstr_f(const char * strFormat, ...)
{
va_list args;
va_start(args, strFormat);
ArgFormat(strFormat,args);
va_end(args);
}

View File

@ -38,8 +38,10 @@ public:
stdstr & TrimLeft(const char * chars2remove = "\t ");
stdstr & TrimRight(const char * chars2remove = "\t ");
#ifdef _WIN32
stdstr & FromUTF16(const wchar_t * UTF16Source, bool * bSuccess = NULL);
std::wstring ToUTF16(unsigned int CodePage = CODEPAGE_UTF8, bool * bSuccess = NULL);
#endif
void ArgFormat(const char * strFormat, va_list & args);
};
@ -47,13 +49,7 @@ public:
class stdstr_f : public stdstr
{
public:
stdstr_f(const char * strFormat, ...)
{
va_list args;
va_start(args, strFormat);
ArgFormat(strFormat, args);
va_end(args);
}
stdstr_f(const char * strFormat, ...);
};
class stdwstr_f : public std::wstring

View File

@ -1,8 +1,9 @@
#include "stdafx.h"
#include <windows.h>
SyncEvent::SyncEvent(bool bManualReset)
{
m_Event = CreateEvent(NULL, bManualReset, FALSE, NULL);
m_Event = CreateEvent(NULL, bManualReset, false, NULL);
}
SyncEvent::~SyncEvent()

View File

@ -1,4 +1,5 @@
#include "stdafx.h"
#include <windows.h>
typedef std::map<uint32_t, stdstr> ModuleNameMap;

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "Util.h"
#include <windows.h>
#include <Tlhelp32.h>
void pjutil::Sleep(uint32_t timeout)

View File

@ -40,6 +40,7 @@
*/
#include "stdafx.h"
#include <windows.h>
// MD5 simple initialization method
MD5::MD5()

View File

@ -385,7 +385,7 @@ std::string CPath::GetExtension(void) const
//-------------------------------------------------------------
// Task : Get current directory
//-------------------------------------------------------------
void CPath::GetCurrentDirectory(std::string& rDirectory) const
void CPath::GetLastDirectory(std::string& rDirectory) const
{
std::string Directory;
@ -394,18 +394,19 @@ void CPath::GetCurrentDirectory(std::string& rDirectory) const
GetDirectory(Directory);
StripTrailingBackslash(Directory);
if(Directory.empty())
{
return;
}
std::string::size_type nDelimiter = Directory.rfind(DIRECTORY_DELIMITER);
rDirectory = Directory.substr(nDelimiter);
StripLeadingBackslash(rDirectory);
}
std::string CPath::GetCurrentDirectory(void) const
std::string CPath::GetLastDirectory(void) const
{
std::string rDirecotry;
GetCurrentDirectory(rDirecotry);
GetLastDirectory(rDirecotry);
return rDirecotry;
}

View File

@ -73,8 +73,8 @@ public:
std::string GetNameExtension(void) const;
void GetExtension(std::string& rExtension) const;
std::string GetExtension(void) const;
void GetCurrentDirectory(std::string& rDrive) const;
std::string GetCurrentDirectory(void) const;
void GetLastDirectory(std::string& rDrive) const;
std::string GetLastDirectory(void) const;
void GetFullyQualified(std::string& rFullyQualified) const;
void GetComponents(std::string* pDrive = NULL,
std::string* pDirectory =NULL,

View File

@ -527,7 +527,7 @@ bool CRomBrowser::GetRomFileNames(strlist & FileList, const CPath & BaseDirector
{
if (g_Settings->LoadDword(RomBrowser_Recursive))
{
stdstr CurrentDir = Directory + SearchPath.GetCurrentDirectory() + "\\";
stdstr CurrentDir = Directory + SearchPath.GetLastDirectory() + "\\";
GetRomFileNames(FileList, BaseDirectory, CurrentDir, InWatchThread);
}
}
@ -597,7 +597,7 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c
{
if (g_Settings->LoadDword(RomBrowser_Recursive))
{
stdstr CurrentDir = Directory + SearchPath.GetCurrentDirectory() + "\\";
stdstr CurrentDir = Directory + SearchPath.GetLastDirectory() + "\\";
FillRomList(FileList, BaseDirectory, CurrentDir, lpLastRom);
}
continue;