Skip to content

Commit

Permalink
fix compilation on win
Browse files Browse the repository at this point in the history
  • Loading branch information
Murmele committed Nov 1, 2023
1 parent b08b683 commit 706f288
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
21 changes: 11 additions & 10 deletions src/app/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,20 @@ static LONG WINAPI exceptionFilter(PEXCEPTION_POINTERS info) {
SYSTEMTIME localTime;
GetLocalTime(&localTime);

char temp[MAX_PATH];
wchar_t temp[MAX_PATH];
GetTempPath(MAX_PATH, temp);

char dir[MAX_PATH];
StringCchPrintf(dir, MAX_PATH, "%sGittyup", temp);
wchar_t dir[MAX_PATH];
const wchar_t *gittyup_name = L"%sGittyup";
StringCchPrintf(dir, MAX_PATH, gittyup_name, temp);
CreateDirectory(dir, NULL);

char fileName[MAX_PATH];
StringCchPrintf(
fileName, MAX_PATH, "%s\\%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp",
dir, GITTYUP_NAME, GITTYUP_VERSION, localTime.wYear, localTime.wMonth,
localTime.wDay, localTime.wHour, localTime.wMinute, localTime.wSecond,
GetCurrentProcessId(), GetCurrentThreadId());
wchar_t fileName[MAX_PATH];
const wchar_t *s = L"%s\\%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp";
StringCchPrintf(fileName, MAX_PATH, s, dir, GITTYUP_NAME, GITTYUP_VERSION,
localTime.wYear, localTime.wMonth, localTime.wDay,
localTime.wHour, localTime.wMinute, localTime.wSecond,
GetCurrentProcessId(), GetCurrentThreadId());

HANDLE dumpFile =
CreateFile(fileName, GENERIC_READ | GENERIC_WRITE,
Expand Down Expand Up @@ -352,7 +353,7 @@ class CopyDataWindow : public QWindow {

protected:
virtual bool nativeEvent(const QByteArray &eventType, void *message,
long *result) Q_DECL_OVERRIDE {
qintptr *result) Q_DECL_OVERRIDE {
MSG *msg = (MSG *)message;

if (msg->message == WM_COPYDATA) {
Expand Down
13 changes: 7 additions & 6 deletions src/index/indexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@ static LONG WINAPI exceptionFilter(PEXCEPTION_POINTERS info) {
GetTempPath(MAX_PATH, temp);

wchar_t dir[MAX_PATH];
StringCchPrintf(dir, MAX_PATH, "%sGittyup", temp);
const wchar_t *gittyup_name = L"%sGittyup";
StringCchPrintf(dir, MAX_PATH, gittyup_name, temp);
CreateDirectory(dir, NULL);

wchar_t fileName[MAX_PATH];
StringCchPrintf(
fileName, MAX_PATH, "%s\\%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp",
dir, "indexer", GITTYUP_VERSION, localTime.wYear, localTime.wMonth,
localTime.wDay, localTime.wHour, localTime.wMinute, localTime.wSecond,
GetCurrentProcessId(), GetCurrentThreadId());
const wchar_t *s = L"%s\\%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp";
StringCchPrintf(fileName, MAX_PATH, s, dir, "indexer", GITTYUP_VERSION,
localTime.wYear, localTime.wMonth, localTime.wDay,
localTime.wHour, localTime.wMinute, localTime.wSecond,
GetCurrentProcessId(), GetCurrentThreadId());

HANDLE dumpFile =
CreateFile(fileName, GENERIC_READ | GENERIC_WRITE,
Expand Down

0 comments on commit 706f288

Please sign in to comment.