mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-24 05:52:15 +00:00
refactor path interface:
- use wrapper class instead of std::wstring (reduces mixing of strings/paths; allows safe+easy join via operator/ and convenient case-insensitive comparison via operator==, avoids NativePathFromString, similar to boost::filesystem) - NativePath -> OsPath - add hash and To/FromJSVal for Path - add TS_ASSERT_PATH_EQUALS - replace _wfopen_s with sys_OpenFile - remove obsolete SortFiles/Directories This was SVN commit r9107.
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "lib/svn_revision.h"
|
||||
#include "lib/timer.h"
|
||||
#include "lib/utf8.h"
|
||||
#include "lib/sysdep/sysdep.h" // sys_OpenFile
|
||||
#include "maths/scripting/JSInterface_Vector3D.h"
|
||||
#include "network/NetServer.h"
|
||||
#include "ps/CConsole.h"
|
||||
@@ -279,13 +280,8 @@ void DumpHeap(const char* basename, int idx, JSContext* cx)
|
||||
{
|
||||
char filename[64];
|
||||
sprintf_s(filename, ARRAY_SIZE(filename), "%s.%03d.txt", basename, idx);
|
||||
NativePath pathname = Path::Join(psLogDir(), filename);
|
||||
#if OS_WIN
|
||||
FILE* f = _wfopen(pathname.c_str(), L"w");
|
||||
#else
|
||||
std::string pathname8 = StringFromNativePath(pathname);
|
||||
FILE* f = fopen(pathname8.c_str(), "w");
|
||||
#endif
|
||||
OsPath pathname = psLogDir() / filename;
|
||||
FILE* f = sys_OpenFile(pathname, "w");
|
||||
debug_assert(f);
|
||||
JS_DumpHeap(cx, f, NULL, 0, NULL, (size_t)-1, NULL);
|
||||
fclose(f);
|
||||
|
||||
Reference in New Issue
Block a user