[Project64] Add Platform.cpp

This commit is contained in:
zilmar 2016-01-04 17:49:33 +11:00
parent 008dec1f59
commit 1e30be0945
5 changed files with 35 additions and 2 deletions

View File

@ -39,6 +39,7 @@
<ClCompile Include="md5.cpp" />
<ClCompile Include="MemTest.cpp" />
<ClCompile Include="path.cpp" />
<ClCompile Include="Platform.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
@ -55,6 +56,7 @@
<ClInclude Include="md5.h" />
<ClInclude Include="MemTest.h" />
<ClInclude Include="path.h" />
<ClInclude Include="Platform.h" />
<ClInclude Include="SmartPointer.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="StdString.h" />

View File

@ -47,6 +47,9 @@
<ClCompile Include="Util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Platform.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
@ -94,5 +97,8 @@
<ClInclude Include="TraceModulesCommon.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Platform.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,13 @@
#include "stdafx.h"
#ifndef _WIN32
int _vscprintf (const char * format, va_list pargs)
{
int retval;
va_list argcopy;
va_copy(argcopy, pargs);
retval = vsnprintf(NULL, 0, format, argcopy);
va_end(argcopy);
return retval;
}
#endif

14
Source/Common/Platform.h Normal file
View File

@ -0,0 +1,14 @@
#pragma once
#ifndef _WIN32
#include <alloca.h>
#include <stdarg.h>
#define _stricmp strcasecmp
#define _strnicmp strncasecmp
#define _snprintf snprintf
#define GetCurrentThreadId pthread_self
int _vscprintf (const char * format, va_list pargs);
#endif

View File

@ -1,10 +1,8 @@
#pragma warning(disable:4786)
#include <map>
#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "MemTest.h"
#include "StdString.h"