diff --git a/.editorconfig b/.editorconfig index 60e03a5d..dff1dba7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,19 +6,6 @@ trim_trailing_whitespace = true insert_final_newline = true end_of_line = crlf charset = latin1 - -[*.cpp] -indent_style = space -indent_size = 4 - -[*.h] -indent_style = space -indent_size = 4 - -[*.rc] -indent_style = space -indent_size = 4 - -[*.yml] indent_style = space indent_size = 4 +charset = utf-8 \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a580a102..78528853 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,18 +41,18 @@ add_library(msvc_console_link_options INTERFACE) target_compile_features(project_compile_features INTERFACE cxx_constexpr cxx_auto_type cxx_final cxx_std_20) target_compile_definitions(project_definitions - INTERFACE - UNICODE - NOMINMAX - WIN32_LEAN_AND_MEAN - _CRT_SECURE_NO_WARNINGS - _WINSOCK_DEPRECATED_NO_WARNINGS - WIN32 - WIN64 - _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING - "_WIN32_WINNT=0x0601" + INTERFACE + UNICODE + NOMINMAX + WIN32_LEAN_AND_MEAN + _CRT_SECURE_NO_WARNINGS + _WINSOCK_DEPRECATED_NO_WARNINGS + WIN32 + WIN64 + _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING + "_WIN32_WINNT=0x0601" ) -# "_ITERATOR_DEBUG_LEVEL=0" # trips over debug/release mismatches +# "_ITERATOR_DEBUG_LEVEL=0" # trips over debug/release mismatches # /Oy and /RELEASE are added to avoid tripping malware detection # this is quite random, ymmv @@ -80,4 +80,3 @@ message("CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}") message("CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}") message("will be installed in: ${CMAKE_INSTALL_PREFIX}") message("\n") - diff --git a/README.md b/README.md index aab39722..52dac460 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -## Contact information - [![Discord Invite](https://img.shields.io/badge/Discord%20Live%20Coding%20Chat-invite-blue)](https://discord.gg/V6HRYgBFUX) ![Mastodon Follow](https://img.shields.io/mastodon/follow/109524813797978857?domain=https%3A%2F%2Ftoot.community&style=social) ![Github Follow](https://img.shields.io/github/followers/janwilmans) -## Debugview++ v1.20.x.x (Summer 2025 Update coming soon!) +## Debugview++ v1.20.0.0 (released 23 April 2026) +- bugfix: every 5000th line was not visible in the viewer (thanks to roman-orekhov for reporting and reproducing) +- bugfix: unicode message were messed up (depending on windows utf-8 settings) - new features: capture kernel messages, verbose mode and pass-through mode, big thanks to x64bugreport and 593749519 for providing information, contributions and test scenarios. - fixed #365: support for messages from UWP applications (poorly tested), feedback welcome! - fixed #396: depending on the runtime dlls, this broke when we moved to cmake, now we link the runtime statically again. @@ -23,7 +23,7 @@ - the OutputForwarder companion extension for VS2022 can be found in the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=JanWilmans.OutputForwarder2022) - nuget.exe can be downloaded from https://www.nuget.org/downloads -## Debugview++, currently at v1.9 (2024 Update!) +## Debugview++, currently at v1.9 (2024) [![All Releases](https://img.shields.io/github/downloads/CobaltFusion/DebugViewPP/total.svg)](https://github.com/CobaltFusion/DebugViewPP/releases/latest) [![Current Release](https://img.shields.io/github/downloads/CobaltFusion/DebugViewPP/latest/total.svg)](https://github.com/CobaltFusion/DebugViewPP/releases/latest) diff --git a/application/CobaltFusion/CMakeLists.txt b/application/CobaltFusion/CMakeLists.txt index 44ea63b3..9d7ec27d 100644 --- a/application/CobaltFusion/CMakeLists.txt +++ b/application/CobaltFusion/CMakeLists.txt @@ -13,12 +13,12 @@ add_library(${PROJECT_NAME} add_library(dv::cobaltfusion ALIAS ${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} - PRIVATE - project::definitions - project::compile_features - project::compile_options - nuget::boost - dv::win32 +PRIVATE + project::definitions + project::compile_features + project::compile_options + nuget::boost + dv::win32 ) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/application/CobaltFusionTest/CMakeLists.txt b/application/CobaltFusionTest/CMakeLists.txt index 2672727e..00266e2e 100644 --- a/application/CobaltFusionTest/CMakeLists.txt +++ b/application/CobaltFusionTest/CMakeLists.txt @@ -3,12 +3,12 @@ project(CobaltFusionTest) add_executable(${PROJECT_NAME} CobaltFusionTest.cpp TestExecutor.cpp TestGuiExecutor.cpp) target_link_libraries(${PROJECT_NAME} - PRIVATE - project::definitions - project::compile_features - project::compile_options - nuget::boost_test - CobaltFusion +PRIVATE + project::definitions + project::compile_features + project::compile_options + nuget::boost_test + CobaltFusion ) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/application/DbgMsgSrc/CMakeLists.txt b/application/DbgMsgSrc/CMakeLists.txt index 43f08e33..b1b4355f 100644 --- a/application/DbgMsgSrc/CMakeLists.txt +++ b/application/DbgMsgSrc/CMakeLists.txt @@ -3,15 +3,15 @@ project(DbgMsgSrc) add_executable(${PROJECT_NAME} DbgMsgSrc.cpp Timer.cpp) target_link_libraries(${PROJECT_NAME} - PRIVATE - project::definitions - project::compile_features - project::compile_options - project::console_link_options - nuget::boost - dv::cobaltfusion - dv::library - dv::win32 +PRIVATE + project::definitions + project::compile_features + project::compile_options + project::console_link_options + nuget::boost + dv::cobaltfusion + dv::library + dv::win32 ) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/application/DbgMsgSrc/DbgMsgSrc.cpp b/application/DbgMsgSrc/DbgMsgSrc.cpp index 1fc60c12..a496b9a9 100644 --- a/application/DbgMsgSrc/DbgMsgSrc.cpp +++ b/application/DbgMsgSrc/DbgMsgSrc.cpp @@ -277,6 +277,22 @@ void EndlessTest() } } +void EncodingTest() +{ + const wchar_t* utf16Message = L"This message is UTF-16 encoded and send through OutputDebugStringW \u65E5\u672C\u8A9E"; // 日本語 UTF-16 encoded + OutputDebugStringW(utf16Message); + + // 日本語 😀" encoded as UTF-8 bytes + const char* utf8Message = "This message is UTF-8 encoded and send through OutputDebugStringA (with special windows settings): " + "\xE6\x97\xA5" // 日 // Ni + "\xE6\x9C\xAC" // 本 // Hon + "\xE8\xAA\x9E" // 語 // Go + " " + "\xF0\x9F\x98\x80"; // 😀 + + OutputDebugStringA(utf8Message); +} + void SeparateProcessTest() { std::cerr << "SeparateProcessTest\n"; @@ -409,6 +425,11 @@ int Main(int argc, char* argv[]) EndlessTest(); return 0; } + else if (arg == "-4") + { + EncodingTest(); + return 0; + } else if (arg == "-s") // run separate process test { SeparateProcessTest(); diff --git a/application/DebugViewConsole/CMakeLists.txt b/application/DebugViewConsole/CMakeLists.txt index cf0d6976..cde25119 100644 --- a/application/DebugViewConsole/CMakeLists.txt +++ b/application/DebugViewConsole/CMakeLists.txt @@ -3,15 +3,15 @@ project(DebugViewConsole) add_executable(DebugViewConsole DebugViewConsole.cpp) target_link_libraries(DebugViewConsole - PRIVATE - project::definitions - project::compile_features - project::compile_options - nuget::boost_test - dv::library - dv::indexedstorage - CobaltFusion - docopt +PRIVATE + project::definitions + project::compile_features + project::compile_options + nuget::boost_test + dv::library + dv::indexedstorage + CobaltFusion + docopt ) install(TARGETS DebugViewConsole RUNTIME DESTINATION bin) @@ -21,16 +21,14 @@ target_include_directories(DebugViewConsole PUBLIC ) add_custom_command( - TARGET DebugViewConsole - POST_BUILD + TARGET DebugViewConsole + POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe -) -install(CODE " - execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe) - execute_process(COMMAND ${PROJECT_UTILS_DIRECTORY}/upx.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe) -") + COMMAND ${PROJECT_UTILS_DIRECTORY}/upx.exe + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe +) -INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe DESTINATION bin) \ No newline at end of file +install(FILES $/DebugViewConsole-small.exe DESTINATION bin) diff --git a/application/DebugViewpp/CMakeLists.txt b/application/DebugViewpp/CMakeLists.txt index 54ed37b2..b6a3e0b2 100644 --- a/application/DebugViewpp/CMakeLists.txt +++ b/application/DebugViewpp/CMakeLists.txt @@ -22,19 +22,19 @@ add_executable(Debugviewpp ) target_link_libraries(Debugviewpp - PRIVATE - project::definitions - project::compile_features - project::compile_options - project::gui_link_options - nuget::boost - nuget::wtl - dv::cobaltfusion - dv::tabbingframework - dv::propertygrid - dv::indexedstorage - dv::library - dv::win32 +PRIVATE + project::definitions + project::compile_features + project::compile_options + project::gui_link_options + nuget::boost + nuget::wtl + dv::cobaltfusion + dv::tabbingframework + dv::propertygrid + dv::indexedstorage + dv::library + dv::win32 ) install(TARGETS Debugviewpp DESTINATION bin) @@ -43,9 +43,15 @@ target_include_directories(Debugviewpp PUBLIC $ ) -install(CODE " - execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp-small.exe) - execute_process(COMMAND ${PROJECT_UTILS_DIRECTORY}/upx.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp-small.exe) -") +add_custom_command( + TARGET Debugviewpp + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + $ + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp-small.exe -INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp-small.exe DESTINATION bin) + COMMAND ${PROJECT_UTILS_DIRECTORY}/upx.exe + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp-small.exe +) + +install(FILES $/Debugviewpp-small.exe DESTINATION bin) diff --git a/application/DebugViewpp/MainFrame.cpp b/application/DebugViewpp/MainFrame.cpp index 2750c924..1d96f9ea 100644 --- a/application/DebugViewpp/MainFrame.cpp +++ b/application/DebugViewpp/MainFrame.cpp @@ -96,7 +96,7 @@ std::wstring FormatDuration(double seconds) return wstringbuilder() << FormatUnits(minutes, L"minute") << L" " << FormatUnits(FloorTo(seconds), L"second"); } - static const wchar_t* units[] = {L"s", L"ms", L"µs", L"ns", nullptr}; + static const wchar_t* units[] = {L"s", L"ms", L"\u03BCs", L"ns", nullptr}; // visualstudio is apparently unable to display the “μs” (microseconds) in UTF-8 encoded files const wchar_t** unit = units; while (*unit != nullptr && seconds > 0 && seconds < 1) { @@ -458,11 +458,9 @@ bool CMainFrame::OnUpdate() int count = 0; for (auto&& line : lines) { - if (count++ < 5000) - { - bucket.emplace_back(std::move(line)); - } - else + ++count; + bucket.emplace_back(std::move(line)); + if (count == 5000) { count = 0; m_incomingMessages.emplace_back(std::move(bucket)); @@ -479,7 +477,6 @@ bool CMainFrame::OnUpdate() return false; } - auto linesbucket = std::move(m_incomingMessages.front()); m_incomingMessages.pop_front(); ProcessLines(linesbucket); @@ -1549,12 +1546,19 @@ void CMainFrame::WriteDriverFromResource() void* pLockedRes = LockResource(hLoadedRes); if (pLockedRes) { + std::cout << "Write " << m_driverLocation << "\n"; std::ofstream outFile(m_driverLocation.c_str(), std::ios::binary); outFile.write(static_cast(pLockedRes), dwSize); outFile.close(); } } } + + if (!std::filesystem::exists(m_driverLocation)) + { + std::cout << "Could not write to " << m_driverLocation << "\n"; + m_logSources.AddMessage("Unable to access kernel messages driver"); + } } void CMainFrame::RemoveDriver() diff --git a/application/DebugViewpp/version.h b/application/DebugViewpp/version.h index 673196cc..ced0201d 100644 --- a/application/DebugViewpp/version.h +++ b/application/DebugViewpp/version.h @@ -1,2 +1,2 @@ -#define VERSION 1,9,0,65 -#define VERSION_STR "1.9.0.65" +#define VERSION 1, 20, 0, 0 +#define VERSION_STR "1.20.0.0" diff --git a/application/DebugViewpp/version.wxi b/application/DebugViewpp/version.wxi index 952533d8..acfd7791 100644 --- a/application/DebugViewpp/version.wxi +++ b/application/DebugViewpp/version.wxi @@ -3,6 +3,6 @@ - - + + diff --git a/application/DebugViewppLib/CMakeLists.txt b/application/DebugViewppLib/CMakeLists.txt index 9b656c19..8d7861dc 100644 --- a/application/DebugViewppLib/CMakeLists.txt +++ b/application/DebugViewppLib/CMakeLists.txt @@ -41,14 +41,14 @@ add_library(${PROJECT_NAME} add_library(dv::library ALIAS ${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} - PRIVATE - project::definitions - project::compile_features - project::compile_options - nuget::boost - nuget::wtl - dv::cobaltfusion - dv::win32 +PRIVATE + project::definitions + project::compile_features + project::compile_options + nuget::boost + nuget::wtl + dv::cobaltfusion + dv::win32 ) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/application/DebugViewppLib/Debugview_kernel_client.cpp b/application/DebugViewppLib/Debugview_kernel_client.cpp index d853c617..814f1f6f 100644 --- a/application/DebugViewppLib/Debugview_kernel_client.cpp +++ b/application/DebugViewppLib/Debugview_kernel_client.cpp @@ -7,7 +7,6 @@ constexpr const char* DRIVER_SERVICE_NAME = "debugviewdriver"; constexpr const char* DRIVER_DISPLAY_NAME = "DbgView Kernel Message Driver"; -const std::string driverPath = "C:\\Windows\\System32\\drivers\\dbgvpp.sys"; bool FileExists(const std::string& path) { @@ -82,9 +81,9 @@ void InstallKernelMessagesDriver(const std::string& driverLocation) // try to uninstall first, in case the driver is somehow still loaded. UninstallKernelMessagesDriver(); - if (!FileExists(driverPath)) + if (!FileExists(driverLocation)) { - std::cout << "Driver file not found at: " << driverPath << std::endl; + std::cout << "Driver file not found at: " << driverLocation << std::endl; } SC_HANDLE hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); diff --git a/application/DebugViewppTest/CMakeLists.txt b/application/DebugViewppTest/CMakeLists.txt index f9a9e71e..b6cc104c 100644 --- a/application/DebugViewppTest/CMakeLists.txt +++ b/application/DebugViewppTest/CMakeLists.txt @@ -3,14 +3,14 @@ project(DebugviewppTest) add_executable(${PROJECT_NAME} DebugView++Test.cpp) target_link_libraries(${PROJECT_NAME} - PRIVATE - project::definitions - project::compile_features - project::compile_options - nuget::boost_test - dv::library - dv::indexedstorage - CobaltFusion +PRIVATE + project::definitions + project::compile_features + project::compile_options + nuget::boost_test + dv::library + dv::indexedstorage + CobaltFusion ) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/application/DebugViewppTest/DebugView++Test.cpp b/application/DebugViewppTest/DebugView++Test.cpp index 1ff29635..9e80f604 100644 --- a/application/DebugViewppTest/DebugView++Test.cpp +++ b/application/DebugViewppTest/DebugView++Test.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "Win32/Utilities.h" #include "Win32/Win32Lib.h" @@ -32,7 +33,7 @@ namespace fusion { namespace debugviewpp { -BOOST_AUTO_TEST_SUITE(DebugViewPlusPlusLib) +BOOST_AUTO_TEST_SUITE(DebugViewPlusPlusTest) std::string GetTestString(size_t i) { @@ -511,6 +512,78 @@ BOOST_AUTO_TEST_CASE(LogSourceDBWinReader) BOOST_TEST(lines.size() == 1); } +BOOST_AUTO_TEST_CASE(LogSourceDBWinReader150KLines) +{ + using namespace std::chrono_literals; + + constexpr int amountOfTestLines = 150000; + auto executor = std::make_unique(); + Lines lines; + { + LogSources logsources(*executor, true); + executor->Call([&] { logsources.SetAutoNewLine(true); }); + executor->Call([&] { logsources.AddDBWinReader(false); }); + + for (int i = 0; i < amountOfTestLines; ++i) + { + std::string message = stringbuilder() << i << '\n'; + OutputDebugStringA(message.c_str()); + } + executor->Call([&] { logsources.Abort(); }); + executor->Call([&] { lines = logsources.GetLines(); }); + } + executor.reset(); + + + for (int i = 0; i < amountOfTestLines; ++i) + { + std::string message = stringbuilder() << i; + if (lines[i].message != message) + { + std::print("'{}' is not '{}'\n", lines[i].message, message); + } + BOOST_TEST(lines[i].message == message); + } + BOOST_TEST(lines.size() == amountOfTestLines); +} + +BOOST_AUTO_TEST_CASE(LogSourceDBWinReader150KLongerLines) +{ + using namespace std::chrono_literals; + + std::string test_string = "ThisIsALongerTestMessageThisIsALongerTestMessageThisIsALongerTestMessageThisIsALongerTestMessage"; + constexpr int amountOfTestLines = 150000; + auto executor = std::make_unique(); + Lines lines; + { + LogSources logsources(*executor, true); + executor->Call([&] { logsources.SetAutoNewLine(true); }); + executor->Call([&] { logsources.AddDBWinReader(false); }); + + for (int i = 0; i < amountOfTestLines; ++i) + { + std::string message = stringbuilder() << i << test_string << test_string << '\n'; + OutputDebugStringA(message.c_str()); + } + executor->Call([&] { logsources.Abort(); }); + executor->Call([&] { lines = logsources.GetLines(); }); + } + executor.reset(); + + + for (int i = 0; i < amountOfTestLines; ++i) + { + std::string message = stringbuilder() << i << test_string << test_string; + if (lines[i].message != message) + { + std::print("'{}' is not '{}'\n", lines[i].message, message); + } + BOOST_TEST(lines[i].message == message); + } + BOOST_TEST(lines.size() == amountOfTestLines); +} + + std::string CreateTestFile() { Timer timer; @@ -594,7 +667,7 @@ std::string GetTestFileAsString() return ss.str(); } -BOOST_AUTO_TEST_CASE(LogSourceAnyFileReaderRewriteByteByByte) +BOOST_AUTO_TEST_CASE(LogSourceAnyFileReaderRewriteByteByByte, *boost::unit_test::disabled()) { using namespace std::chrono_literals; auto executor = std::make_unique(); diff --git a/application/GDIGraphicsPOC/CMakeLists.txt b/application/GDIGraphicsPOC/CMakeLists.txt index 4b11482c..d9307542 100644 --- a/application/GDIGraphicsPOC/CMakeLists.txt +++ b/application/GDIGraphicsPOC/CMakeLists.txt @@ -8,18 +8,18 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - PRIVATE - project::definitions - project::compile_features - project::compile_options - project::gui_link_options - nuget::boost - nuget::wtl - dv::cobaltfusion - dv::tabbingframework - dv::propertygrid - dv::library - dv::win32 +PRIVATE + project::definitions + project::compile_features + project::compile_options + project::gui_link_options + nuget::boost + nuget::wtl + dv::cobaltfusion + dv::tabbingframework + dv::propertygrid + dv::library + dv::win32 ) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/application/IndexedStorageLib/CMakeLists.txt b/application/IndexedStorageLib/CMakeLists.txt index 82dc2da7..11c0aec4 100644 --- a/application/IndexedStorageLib/CMakeLists.txt +++ b/application/IndexedStorageLib/CMakeLists.txt @@ -4,12 +4,12 @@ add_library(${PROJECT_NAME} IndexedStorage.cpp) add_library(dv::indexedstorage ALIAS ${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} - PRIVATE - project::definitions - project::compile_features - project::compile_options - nuget::snappy - dv::win32 +PRIVATE + project::definitions + project::compile_features + project::compile_options + nuget::snappy + dv::win32 ) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/application/Libraries/docopt.cpp/CMakeLists.txt b/application/Libraries/docopt.cpp/CMakeLists.txt index ce638f8f..4b31e014 100644 --- a/application/Libraries/docopt.cpp/CMakeLists.txt +++ b/application/Libraries/docopt.cpp/CMakeLists.txt @@ -17,7 +17,7 @@ option(USE_BOOST_REGEX "Replace std::regex with Boost.Regex" OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) if(NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 11) - set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD 11) endif() #============================================================================ @@ -25,11 +25,11 @@ endif() #============================================================================ set(docopt_SOURCES docopt.cpp) set(docopt_HEADERS - docopt.h - docopt_private.h - docopt_util.h - docopt_value.h - ) + docopt.h + docopt_private.h + docopt_util.h + docopt_value.h + ) #============================================================================ # Compile targets @@ -52,10 +52,10 @@ if(MSVC AND BUILD_SHARED_LIBS) endif() if(USE_BOOST_REGEX) - add_definitions("-DDOCTOPT_USE_BOOST_REGEX") - # This is needed on Linux, where linking a static library into docopt.so - # fails because boost static libs are not compiled with -fPIC - set(Boost_USE_STATIC_LIBS OFF) + add_definitions("-DDOCTOPT_USE_BOOST_REGEX") + # This is needed on Linux, where linking a static library into docopt.so + # fails because boost static libs are not compiled with -fPIC + set(Boost_USE_STATIC_LIBS OFF) find_package(Boost 1.53 REQUIRED COMPONENTS regex) include_directories(${Boost_INCLUDE_DIRS}) target_link_libraries(docopt ${Boost_LIBRARIES}) @@ -65,24 +65,24 @@ endif() # Examples #============================================================================ if(WITH_EXAMPLE) - add_executable(docopt_example examples/naval_fate.cpp) - target_link_libraries(docopt_example docopt) + add_executable(docopt_example examples/naval_fate.cpp) + target_link_libraries(docopt_example docopt) endif() #============================================================================ # Tests #============================================================================ if(WITH_TESTS) - set(TESTPROG "${CMAKE_CURRENT_BINARY_DIR}/run_testcase") - set(TESTCASES "${PROJECT_SOURCE_DIR}/testcases.docopt") - add_executable(run_testcase run_testcase.cpp) - target_link_libraries(run_testcase docopt) - configure_file( - "${PROJECT_SOURCE_DIR}/run_tests.py" - "${CMAKE_CURRENT_BINARY_DIR}/run_tests" - ESCAPE_QUOTES - ) - add_test("Testcases docopt" ${TESTPROG}) + set(TESTPROG "${CMAKE_CURRENT_BINARY_DIR}/run_testcase") + set(TESTCASES "${PROJECT_SOURCE_DIR}/testcases.docopt") + add_executable(run_testcase run_testcase.cpp) + target_link_libraries(run_testcase docopt) + configure_file( + "${PROJECT_SOURCE_DIR}/run_tests.py" + "${CMAKE_CURRENT_BINARY_DIR}/run_tests" + ESCAPE_QUOTES + ) + add_test("Testcases docopt" ${TESTPROG}) endif() #============================================================================ @@ -92,9 +92,9 @@ set(export_name "docopt-targets") # Runtime package install(TARGETS docopt EXPORT ${export_name} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) # Development package install(FILES ${docopt_HEADERS} DESTINATION include/docopt) diff --git a/application/Win32Lib/CMakeLists.txt b/application/Win32Lib/CMakeLists.txt index 28b58271..249a6b3b 100644 --- a/application/Win32Lib/CMakeLists.txt +++ b/application/Win32Lib/CMakeLists.txt @@ -4,10 +4,10 @@ add_library(${PROJECT_NAME} Com.cpp Process.cpp Registry.cpp Socket.cpp Utilitie add_library(dv::win32 ALIAS ${PROJECT_NAME}) target_link_libraries(${PROJECT_NAME} - PRIVATE - project::definitions - project::compile_features - project::compile_options +PRIVATE + project::definitions + project::compile_features + project::compile_options ) target_include_directories(win32lib PUBLIC diff --git a/application/Win32Lib/Win32Lib.cpp b/application/Win32Lib/Win32Lib.cpp index 0b82dc83..87b83c75 100644 --- a/application/Win32Lib/Win32Lib.cpp +++ b/application/Win32Lib/Win32Lib.cpp @@ -411,7 +411,7 @@ WaitResult WaitForMultipleObjects(const HANDLE* begin, const HANDLE* end, bool w { ThrowLastError("WaitForMultipleObjects"); } - if (rc >= WAIT_OBJECT_0 && rc < WAIT_OBJECT_0 + count) + if (rc < WAIT_OBJECT_0 + count) { return WaitResult(true, rc - WAIT_OBJECT_0); } diff --git a/application/include/CobaltFusion/stringbuilder.h b/application/include/CobaltFusion/stringbuilder.h index 5ea58dfe..68144f70 100644 --- a/application/include/CobaltFusion/stringbuilder.h +++ b/application/include/CobaltFusion/stringbuilder.h @@ -54,9 +54,9 @@ class wstringbuilder wstringbuilder& operator<<(const std::string& str) { - m_ss << WStr(str); + m_ss << WStr(str).str(); return *this; - } + } operator std::wstring() const { diff --git a/utils/upx.exe b/utils/upx.exe index 50aac926..f092ae5b 100644 Binary files a/utils/upx.exe and b/utils/upx.exe differ