Unfortunate include of 'windows.h' in operations.hpp (Bug #2122)


Added by hype blade over 12 years ago. Updated about 12 years ago.


Status:Done Start date:2012-07-02
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Hi there,
we just migrated our projects to the new OpenCV 2.4.1 but encountered many problems concerning include hierarchies since "windows.h" is now ALWAYS included by default through the "core/operations.hpp" header which itself is included by "core/core.hpp".

This is quite a disadvantage of the new opencv version since it messes up all/many projects that also have to include "windows.h" or ATL headers.

Looking into the old "operations.hpp" file I can find this code block:

#elif defined WIN32 || defined _WIN32
  #include <intrin.h>
  #define CV_XADD(addr,delta) _InterlockedExchangeAdd((long volatile*)(addr), (delta))
#else

whereas the new "operations.hpp" shows this code:
#elif defined WIN32 || defined _WIN32
  #define WIN32_MEAN_AND_LEAN
  #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 <windows.h>
  #undef min
  #undef max
  #undef abs
  #define CV_XADD(addr,delta) InterlockedExchangeAdd((long volatile*)(addr), (delta))
#else

Wouldn't it be possible to get the main header files of OpenCV "windows-h"-free again? This would be great!

Regards
Matthias


Associated revisions

Revision a135e862
Added by Vadim Pisarevsky over 12 years ago

made opencv headers windows.h-less (Bug #2122)

Revision 659c5345
Added by Roman Donchenko about 11 years ago

Merge pull request #2122 from adishavit:feature-HandleMouseWheel

History

Updated by Andrey Kamaev over 12 years ago

  • Category set to core

Updated by Alexander Smorkalov over 12 years ago

  • Assignee set to Vadim Pisarevsky
  • Target version set to 2.4.3

Updated by Vadim Pisarevsky over 12 years ago

  • Target version deleted (2.4.3)

Updated by Vadim Pisarevsky over 12 years ago

fixed in a135e86

  • Status changed from Open to Done

Updated by Andrey Kamaev about 12 years ago

  • Target version set to 2.4.3

Also available in: Atom PDF