summaryrefslogtreecommitdiffstats
path: root/source/main.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-22 09:06:56 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-22 09:06:56 +0100
commite2e261dd17a0e1bf92d09b8120c374ceed416322 (patch)
tree9462ac5ef864fff9000da58454e18c819611e417 /source/main.cpp
parentAdded code to produce dump files on Windows builds to aid with debugging server crashes (diff)
downloadcuberite-e2e261dd17a0e1bf92d09b8120c374ceed416322.tar
cuberite-e2e261dd17a0e1bf92d09b8120c374ceed416322.tar.gz
cuberite-e2e261dd17a0e1bf92d09b8120c374ceed416322.tar.bz2
cuberite-e2e261dd17a0e1bf92d09b8120c374ceed416322.tar.lz
cuberite-e2e261dd17a0e1bf92d09b8120c374ceed416322.tar.xz
cuberite-e2e261dd17a0e1bf92d09b8120c374ceed416322.tar.zst
cuberite-e2e261dd17a0e1bf92d09b8120c374ceed416322.zip
Diffstat (limited to 'source/main.cpp')
-rw-r--r--source/main.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/main.cpp b/source/main.cpp
index 14c031e9e..c84980853 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -55,9 +55,9 @@ void ShowCrashReport(int)
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_WIN64)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// Windows stuff: when the server crashes, create a "dump file" containing the callstack of each thread and some variables; let the user send us that crash file for analysis
+// Windows 32-bit stuff: when the server crashes, create a "dump file" containing the callstack of each thread and some variables; let the user send us that crash file for analysis
typedef BOOL (WINAPI *pMiniDumpWriteDump)(
HANDLE hProcess,
@@ -88,6 +88,7 @@ LONG WINAPI LastChanceExceptionFilter(__in struct _EXCEPTION_POINTERS * a_Except
char * oldStack;
// Use the substitute stack:
+ // This code is the reason why we don't support 64-bit (yet)
_asm
{
mov oldStack, esp
@@ -113,7 +114,7 @@ LONG WINAPI LastChanceExceptionFilter(__in struct _EXCEPTION_POINTERS * a_Except
return 0;
}
-#endif // _WIN32
+#endif // _WIN32 && !_WIN64
@@ -131,7 +132,7 @@ int main( int argc, char **argv )
#endif
// Magic code to produce dump-files on Windows if the server crashes:
- #ifdef _WIN32
+ #if defined(_WIN32) && !defined(_WIN64)
HINSTANCE hDbgHelp = LoadLibrary("DBGHELP.DLL");
g_WriteMiniDump = (pMiniDumpWriteDump)GetProcAddress(hDbgHelp, "MiniDumpWriteDump");
if (g_WriteMiniDump != NULL)
@@ -139,7 +140,7 @@ int main( int argc, char **argv )
_snprintf_s(g_DumpFileName, ARRAYCOUNT(g_DumpFileName), _TRUNCATE, "crash_mcs_%x.dmp", GetCurrentProcessId());
SetUnhandledExceptionFilter(LastChanceExceptionFilter);
}
- #endif // _WIN32
+ #endif // _WIN32 && !_WIN64
// End of dump-file magic
#ifdef _DEBUG