mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 02:40:20 +08:00
fix: fixed Windows build
This commit is contained in:
parent
a336abc923
commit
94d3d6f650
@ -223,11 +223,15 @@ if(ANDROID)
|
||||
add_library(qv2ray SHARED ${QV2RAY_FULL_SOURCES})
|
||||
target_link_libraries(qv2ray -llog -landroid)
|
||||
else()
|
||||
add_subdirectory(3rdparty/backward-cpp)
|
||||
add_executable(qv2ray ${GUI_TYPE} ${QV2RAY_FULL_SOURCES} ${BACKWARD_ENABLE})
|
||||
# This will add libraries, definitions and include directories needed by backward
|
||||
# by setting each property on the target.
|
||||
add_backward(qv2ray)
|
||||
if (WIN32)
|
||||
add_executable(qv2ray ${GUI_TYPE} ${QV2RAY_FULL_SOURCES})
|
||||
else()
|
||||
add_subdirectory(3rdparty/backward-cpp)
|
||||
add_executable(qv2ray ${GUI_TYPE} ${QV2RAY_FULL_SOURCES} ${BACKWARD_ENABLE})
|
||||
# This will add libraries, definitions and include directories needed by backward
|
||||
# by setting each property on the target.
|
||||
add_backward(qv2ray)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -1 +1 @@
|
||||
5679
|
||||
5680
|
||||
|
@ -4,6 +4,11 @@
|
||||
#ifdef Q_OS_LINUX
|
||||
#include "backward.hpp"
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Windows.h>
|
||||
//
|
||||
#include <DbgHelp.h>
|
||||
#endif
|
||||
|
||||
namespace Qv2ray
|
||||
{
|
||||
@ -16,6 +21,8 @@ namespace Qv2ray
|
||||
return GetStackTraceImpl_Linux();
|
||||
#elif defined(Q_OS_WIN)
|
||||
return GetStackTraceImpl_Windows();
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -54,6 +61,7 @@ namespace Qv2ray
|
||||
void *stack[1024];
|
||||
HANDLE process = GetCurrentProcess();
|
||||
SymInitialize(process, NULL, TRUE);
|
||||
SymSetOptions(SYMOPT_LOAD_ANYTHING);
|
||||
WORD numberOfFrames = CaptureStackBackTrace(0, 1024, stack, NULL);
|
||||
SYMBOL_INFO *symbol = (SYMBOL_INFO *) malloc(sizeof(SYMBOL_INFO) + (512 - 1) * sizeof(TCHAR));
|
||||
symbol->MaxNameLen = 512;
|
||||
|
@ -30,7 +30,8 @@ void signalHandler(int signum)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
qvApp->QuitApplication(-99);
|
||||
// qvApp->QuitApplication(-99);
|
||||
exit(-99);
|
||||
}
|
||||
|
||||
Qv2rayExitCode RunQv2rayApplicationScoped(int argc, char *argv[])
|
||||
|
Loading…
Reference in New Issue
Block a user