Skip to content

Commit

Permalink
Merge pull request #141 from brechtsanders/master
Browse files Browse the repository at this point in the history
Fix version 17.1.460 for building with MinGW-w64
  • Loading branch information
smasherprog authored Oct 16, 2022
2 parents 97c5521 + abaab3f commit 7586bd5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/internal/SCCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
namespace SL {
namespace Screen_Capture {
template <typename F, typename M, typename W> struct CaptureData {
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
std::atomic<std::shared_ptr<Timer> > FrameTimer;
#else
std::shared_ptr<Timer> FrameTimer;
#endif
F OnNewFrame;
F OnFrameChanged;
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
std::atomic<std::shared_ptr<Timer> > MouseTimer;
#else
std::shared_ptr<Timer> MouseTimer;
Expand Down
4 changes: 2 additions & 2 deletions include/internal/ThreadManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace Screen_Capture {
// get a copy of the shared_ptr in a safe way

frameprocessor.Resume();
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
auto timer = data->ScreenCaptureData.FrameTimer.load();
#else
auto timer = std::atomic_load(&data->ScreenCaptureData.FrameTimer);
Expand Down Expand Up @@ -149,7 +149,7 @@ namespace Screen_Capture {
}
while (!data->CommonData_.TerminateThreadsEvent) {
// get a copy of the shared_ptr in a safe way
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
auto timer = data->WindowCaptureData.FrameTimer.load();
#else
auto timer = std::atomic_load(&data->WindowCaptureData.FrameTimer);
Expand Down
6 changes: 4 additions & 2 deletions src_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ add_library(${PROJECT_NAME}_static STATIC ${libsrc})
set_target_properties(${PROJECT_NAME}_shared PROPERTIES DEFINE_SYMBOL SC_LITE_DLL)
if(WIN32)
target_link_libraries(${PROJECT_NAME}_shared Dwmapi)
install (FILES $<TARGET_PDB_FILE:${PROJECT_NAME}_shared> DESTINATION bin OPTIONAL)
if (!MINGW)
install (FILES $<TARGET_PDB_FILE:${PROJECT_NAME}_shared> DESTINATION bin OPTIONAL)
endif()
elseif(APPLE)
find_package(Threads REQUIRED)
find_library(corefoundation_lib CoreFoundation REQUIRED)
Expand Down Expand Up @@ -125,4 +127,4 @@ add_library(${PROJECT_NAME}_static STATIC ${libsrc})
${CMAKE_THREAD_LIBS_INIT}
)
endif()


4 changes: 2 additions & 2 deletions src_cpp/ScreenCapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ScreenCaptureManager : public IScreenCaptureManager {

virtual void setFrameChangeInterval(const std::shared_ptr<Timer> &timer) override
{
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
Thread_Data_->ScreenCaptureData.FrameTimer.store(timer);
Thread_Data_->WindowCaptureData.FrameTimer.store(timer);
#else
Expand All @@ -139,7 +139,7 @@ class ScreenCaptureManager : public IScreenCaptureManager {

virtual void setMouseChangeInterval(const std::shared_ptr<Timer> &timer) override
{
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
Thread_Data_->ScreenCaptureData.MouseTimer.store(timer);
Thread_Data_->WindowCaptureData.MouseTimer.store(timer);
#else
Expand Down

0 comments on commit 7586bd5

Please sign in to comment.