diff --git a/modules/core/include/opencv2/core/internal.hpp b/modules/core/include/opencv2/core/internal.hpp index b1d8cf848..93e56c3ab 100644 --- a/modules/core/include/opencv2/core/internal.hpp +++ b/modules/core/include/opencv2/core/internal.hpp @@ -59,16 +59,7 @@ # endif #endif -#if defined WIN32 || defined WINCE -# ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?) -# define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx -# endif -# include -# undef small -# undef min -# undef max -# undef abs -#else +#if !defined WIN32 && !defined WINCE # include #endif diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp index 014b10710..2bc8a0588 100644 --- a/modules/core/src/parallel.cpp +++ b/modules/core/src/parallel.cpp @@ -42,6 +42,14 @@ #include "precomp.hpp" +#if defined WIN32 || defined WINCE + #include + #undef small + #undef min + #undef max + #undef abs +#endif + #if defined __linux__ || defined __APPLE__ #include #include diff --git a/modules/core/src/rand.cpp b/modules/core/src/rand.cpp index 8861b9ad2..bae8eae89 100644 --- a/modules/core/src/rand.cpp +++ b/modules/core/src/rand.cpp @@ -48,8 +48,16 @@ #include "precomp.hpp" +#if defined WIN32 || defined WINCE + #include + #undef small + #undef min + #undef max + #undef abs +#endif + #if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP) -#include "emmintrin.h" + #include "emmintrin.h" #endif namespace cv diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index d463a84ef..e0932a79f 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -43,6 +43,14 @@ #include "precomp.hpp" #if defined WIN32 || defined _WIN32 || defined WINCE +#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?) + #define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx +#endif +#include +#undef small +#undef min +#undef max +#undef abs #include #if defined _MSC_VER #if _MSC_VER >= 1400 diff --git a/modules/highgui/src/precomp.hpp b/modules/highgui/src/precomp.hpp index 7ad292b63..0cef4e77a 100644 --- a/modules/highgui/src/precomp.hpp +++ b/modules/highgui/src/precomp.hpp @@ -49,11 +49,6 @@ #include "opencv2/imgproc/imgproc_c.h" #include "opencv2/core/internal.hpp" -#if defined WIN32 || defined _WIN32 -//required windows.h has to be included by the opencv2/core/internal.hpp -void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin ); -#endif - #include #include #include @@ -61,6 +56,14 @@ void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origi #include #include +#if defined WIN32 || defined WINCE + #include + #undef small + #undef min + #undef max + #undef abs +#endif + #ifdef HAVE_TEGRA_OPTIMIZATION #include "opencv2/highgui/highgui_tegra.hpp" #endif diff --git a/modules/highgui/src/window_w32.cpp b/modules/highgui/src/window_w32.cpp index 02c69115c..348420afd 100644 --- a/modules/highgui/src/window_w32.cpp +++ b/modules/highgui/src/window_w32.cpp @@ -106,7 +106,7 @@ static const char* trackbar_text = #endif -void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin ) +static void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin ) { assert( bmi && width >= 0 && height >= 0 && (bpp == 8 || bpp == 24 || bpp == 32));