made opencv headers windows.h-less (Bug #2122)
This commit is contained in:
parent
df8364ce63
commit
a135e862c1
@ -67,6 +67,7 @@
|
|||||||
# undef small
|
# undef small
|
||||||
# undef min
|
# undef min
|
||||||
# undef max
|
# undef max
|
||||||
|
# undef abs
|
||||||
#else
|
#else
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -75,16 +75,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined WIN32 || defined _WIN32
|
#elif defined WIN32 || defined _WIN32 || defined WINCE
|
||||||
#define WIN32_MEAN_AND_LEAN
|
namespace cv { CV_EXPORTS int _interlockedExchangeAdd(int* addr, int delta); }
|
||||||
#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
|
#define CV_XADD cv::_interlockedExchangeAdd
|
||||||
#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
|
#else
|
||||||
static inline int CV_XADD(int* addr, int delta)
|
static inline int CV_XADD(int* addr, int delta)
|
||||||
|
@ -948,6 +948,15 @@ struct Mutex::Impl
|
|||||||
int refcount;
|
int refcount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int _interlockedExchangeAdd(int* addr, int delta)
|
||||||
|
{
|
||||||
|
#if defined _MSC_VER && _MSC_VER >= 1500
|
||||||
|
return (int)_InterlockedExchangeAdd((long volatile*)addr, delta);
|
||||||
|
#else
|
||||||
|
return (int)InterlockedExchangeAdd((long volatile*)addr, delta);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#elif defined __APPLE__
|
#elif defined __APPLE__
|
||||||
|
|
||||||
#include <libkern/OSAtomic.h>
|
#include <libkern/OSAtomic.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user