Skip to content

Commit 7586bd5

Browse files
authored
Merge pull request #141 from brechtsanders/master
Fix version 17.1.460 for building with MinGW-w64
2 parents 97c5521 + abaab3f commit 7586bd5

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

include/internal/SCCommon.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
namespace SL {
88
namespace Screen_Capture {
99
template <typename F, typename M, typename W> struct CaptureData {
10-
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
10+
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
1111
std::atomic<std::shared_ptr<Timer> > FrameTimer;
1212
#else
1313
std::shared_ptr<Timer> FrameTimer;
1414
#endif
1515
F OnNewFrame;
1616
F OnFrameChanged;
17-
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
17+
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
1818
std::atomic<std::shared_ptr<Timer> > MouseTimer;
1919
#else
2020
std::shared_ptr<Timer> MouseTimer;

include/internal/ThreadManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace Screen_Capture {
9999
// get a copy of the shared_ptr in a safe way
100100

101101
frameprocessor.Resume();
102-
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
102+
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
103103
auto timer = data->ScreenCaptureData.FrameTimer.load();
104104
#else
105105
auto timer = std::atomic_load(&data->ScreenCaptureData.FrameTimer);
@@ -149,7 +149,7 @@ namespace Screen_Capture {
149149
}
150150
while (!data->CommonData_.TerminateThreadsEvent) {
151151
// get a copy of the shared_ptr in a safe way
152-
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
152+
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
153153
auto timer = data->WindowCaptureData.FrameTimer.load();
154154
#else
155155
auto timer = std::atomic_load(&data->WindowCaptureData.FrameTimer);

src_cpp/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ add_library(${PROJECT_NAME}_static STATIC ${libsrc})
8787
set_target_properties(${PROJECT_NAME}_shared PROPERTIES DEFINE_SYMBOL SC_LITE_DLL)
8888
if(WIN32)
8989
target_link_libraries(${PROJECT_NAME}_shared Dwmapi)
90-
install (FILES $<TARGET_PDB_FILE:${PROJECT_NAME}_shared> DESTINATION bin OPTIONAL)
90+
if (!MINGW)
91+
install (FILES $<TARGET_PDB_FILE:${PROJECT_NAME}_shared> DESTINATION bin OPTIONAL)
92+
endif()
9193
elseif(APPLE)
9294
find_package(Threads REQUIRED)
9395
find_library(corefoundation_lib CoreFoundation REQUIRED)
@@ -125,4 +127,4 @@ add_library(${PROJECT_NAME}_static STATIC ${libsrc})
125127
${CMAKE_THREAD_LIBS_INIT}
126128
)
127129
endif()
128-
130+

src_cpp/ScreenCapture.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class ScreenCaptureManager : public IScreenCaptureManager {
128128

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

140140
virtual void setMouseChangeInterval(const std::shared_ptr<Timer> &timer) override
141141
{
142-
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L
142+
#if defined(_WIN32) && defined(__cplusplus) && __cplusplus >= 202002L && !defined(__MINGW32__)
143143
Thread_Data_->ScreenCaptureData.MouseTimer.store(timer);
144144
Thread_Data_->WindowCaptureData.MouseTimer.store(timer);
145145
#else

0 commit comments

Comments
 (0)