Make CV_XADD independent on STL and system headers

This commit is contained in:
Andrey Kamaev
2013-03-12 19:30:42 +04:00
parent 9f3ce0dd97
commit 013fd9bf59
2 changed files with 22 additions and 39 deletions

View File

@@ -811,17 +811,6 @@ struct Mutex::Impl
int refcount;
};
#ifndef __GNUC__
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
}
#endif // __GNUC__
#elif defined __APPLE__
#include <libkern/OSAtomic.h>