From: Vadim Pisarevsky Date: Fri, 13 May 2011 20:00:58 +0000 (+0000) Subject: removed "#include "windows.h"" from core headers X-Git-Tag: accepted/2.0/20130307.220821~3148 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa2f1c036a4a45eeec9558d0b1c50ec3b3462ea5;p=profile%2Fivi%2Fopencv.git removed "#include "windows.h"" from core headers --- diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index 0d12d5e..24f5684 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -73,27 +73,7 @@ #endif #elif defined WIN32 || defined _WIN32 - - #if defined _MSC_VER && defined _M_IX86 - static inline int CV_XADD( int* addr, int delta ) - { - int tmp; - __asm - { - mov edx, addr - mov eax, delta - lock xadd [edx], eax - mov tmp, eax - } - return tmp; - } - #else - #include "windows.h" - #undef min - #undef max - #define CV_XADD(addr,delta) InterlockedExchangeAdd((LONG volatile*)(addr), (delta)) - #endif - + #define CV_XADD(addr,delta) _InterlockedExchangeAdd((long volatile*)(addr), (delta)) #else template static inline _Tp CV_XADD(_Tp* addr, _Tp delta) diff --git a/modules/highgui/src/window_w32.cpp b/modules/highgui/src/window_w32.cpp index 2ac5e7e..0a2dc10 100644 --- a/modules/highgui/src/window_w32.cpp +++ b/modules/highgui/src/window_w32.cpp @@ -179,6 +179,8 @@ static LRESULT CALLBACK MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LP static void icvUpdateWindowPos( CvWindow* window ); static CvWindow* hg_windows = 0; + +typedef int (CV_CDECL * CvWin32WindowCallback)(HWND, UINT, WPARAM, LPARAM, int*); static CvWin32WindowCallback hg_on_preprocess = 0, hg_on_postprocess = 0; static HINSTANCE hg_hinstance = 0; @@ -1671,8 +1673,6 @@ CV_IMPL const char* cvGetWindowName( void* window_handle ) } -typedef int (CV_CDECL * CvWin32WindowCallback)(HWND, UINT, WPARAM, LPARAM, int*); - CV_IMPL void cvSetPreprocessFuncWin32_(const void* callback) { diff --git a/samples/cpp/bagofwords_classification.cpp b/samples/cpp/bagofwords_classification.cpp index f48ed7c..7203ccc 100644 --- a/samples/cpp/bagofwords_classification.cpp +++ b/samples/cpp/bagofwords_classification.cpp @@ -8,6 +8,10 @@ #include #if defined WIN32 || defined _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#undef min +#undef max #include "sys/types.h" #endif #include