Skip to content

Commit 9c3f957

Browse files
committed
Merge pull request opencv#5282 from mshabunin:mingw-51
2 parents c223c05 + 8c65f8a commit 9c3f957

File tree

14 files changed

+42
-28
lines changed

14 files changed

+42
-28
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON
171171
OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF )
172172
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) )
173173
OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )
174-
OCV_OPTION(WITH_IPP "Include Intel IPP support" ON IF (X86_64 OR X86) AND NOT WINRT)
174+
OCV_OPTION(WITH_IPP "Include Intel IPP support" NOT MINGW IF (X86_64 OR X86) AND NOT WINRT )
175175
OCV_OPTION(WITH_JASPER "Include JPEG2K support" ON IF (NOT IOS) )
176176
OCV_OPTION(WITH_JPEG "Include JPEG support" ON)
177177
OCV_OPTION(WITH_WEBP "Include WebP support" ON IF (NOT IOS AND NOT WINRT) )

modules/core/include/opencv2/core/base.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ enum BorderTypes {
271271
# endif
272272
#endif
273273
#ifndef CV_StaticAssert
274-
# if defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 2)
274+
# if !defined(__clang__) && defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 302)
275275
# define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); })
276276
# else
277277
template <bool x> struct CV_StaticAssert_failed;
@@ -296,7 +296,7 @@ enum BorderTypes {
296296
CV_DO_PRAGMA(warning(push)) \
297297
CV_DO_PRAGMA(warning(disable: 4996))
298298
#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(warning(pop))
299-
#elif defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))))
299+
#elif defined (__clang__) || ((__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 405))
300300
#define CV_SUPPRESS_DEPRECATED_START \
301301
CV_DO_PRAGMA(GCC diagnostic push) \
302302
CV_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")

modules/core/include/opencv2/core/cuda.inl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,15 +578,15 @@ int DeviceInfo::deviceID() const
578578
inline
579579
size_t DeviceInfo::freeMemory() const
580580
{
581-
size_t _totalMemory, _freeMemory;
581+
size_t _totalMemory = 0, _freeMemory = 0;
582582
queryMemory(_totalMemory, _freeMemory);
583583
return _freeMemory;
584584
}
585585

586586
inline
587587
size_t DeviceInfo::totalMemory() const
588588
{
589-
size_t _totalMemory, _freeMemory;
589+
size_t _totalMemory = 0, _freeMemory = 0;
590590
queryMemory(_totalMemory, _freeMemory);
591591
return _totalMemory;
592592
}

modules/core/src/system.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,9 @@ TLSData<CoreTLSData>& getCoreTlsData()
11911191
#pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
11921192
#endif
11931193

1194+
extern "C"
1195+
BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved);
1196+
11941197
extern "C"
11951198
BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved)
11961199
{

modules/cudalegacy/include/opencv2/cudalegacy/NCVHaarObjectDetection.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
// Guaranteed size cross-platform classifier structures
7070
//
7171
//==============================================================================
72-
#if defined __GNUC__ && __GNUC__ > 2 && __GNUC_MINOR__ > 4
72+
#if defined __GNUC__ && (__GNUC__*100 + __GNUC_MINOR__ > 204)
7373
typedef Ncv32f __attribute__((__may_alias__)) Ncv32f_a;
7474
#else
7575
typedef Ncv32f Ncv32f_a;
@@ -208,7 +208,7 @@ struct HaarClassifierNodeDescriptor32
208208
}
209209
};
210210

211-
#if defined __GNUC__ && __GNUC__ > 2 && __GNUC_MINOR__ > 4
211+
#if defined __GNUC__ && (__GNUC__*100 + __GNUC_MINOR__ > 204)
212212
typedef Ncv32u __attribute__((__may_alias__)) Ncv32u_a;
213213
#else
214214
typedef Ncv32u Ncv32u_a;

modules/cudalegacy/src/cuda/NPP_staging.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ NCVStatus nppsStCompact_32s(Ncv32s *d_src, Ncv32u srcLen,
15931593
}
15941594

15951595

1596-
#if defined __GNUC__ && __GNUC__ > 2 && __GNUC_MINOR__ > 4
1596+
#if defined __GNUC__ && (__GNUC__*100 + __GNUC_MINOR__ > 204)
15971597
typedef Ncv32u __attribute__((__may_alias__)) Ncv32u_a;
15981598
#else
15991599
typedef Ncv32u Ncv32u_a;

modules/features2d/src/agast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The references are:
4545
#include "precomp.hpp"
4646
#include "agast_score.hpp"
4747

48-
#ifdef _WIN32
48+
#ifdef _MSC_VER
4949
#pragma warning( disable : 4127 )
5050
#endif
5151

modules/features2d/src/agast_score.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The references are:
4444

4545
#include "agast_score.hpp"
4646

47-
#ifdef _WIN32
47+
#ifdef _MSC_VER
4848
#pragma warning( disable : 4127 )
4949
#endif
5050

modules/highgui/src/window_w32.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,8 +2036,8 @@ icvCreateTrackbar( const char* trackbar_name, const char* window_name,
20362036
trackbar = icvFindTrackbarByName(window,trackbar_name);
20372037
if( !trackbar )
20382038
{
2039-
TBBUTTON tbs = {0};
2040-
TBBUTTONINFO tbis = {0};
2039+
TBBUTTON tbs = {};
2040+
TBBUTTONINFO tbis = {};
20412041
RECT rect;
20422042
int bcount;
20432043
int len = (int)strlen( trackbar_name );

modules/imgcodecs/src/grfmt_jpeg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ ImageDecoder JpegDecoder::newDecoder() const
213213

214214
bool JpegDecoder::readHeader()
215215
{
216-
bool result = false;
216+
volatile bool result = false;
217217
close();
218218

219219
JpegState* state = new JpegState;

0 commit comments

Comments
 (0)