Skip to content

Commit

Permalink
fix win32
Browse files Browse the repository at this point in the history
  • Loading branch information
agilev76 authored and andrey.gilev committed Apr 21, 2020
1 parent f9fa084 commit 1db36b5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions include/services/daal_atomic_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,20 @@ class DAAL_EXPORT Atomic
Atomic & operator=(const Atomic &);
};

#if defined(_WIN32) || defined(_WIN64)
inline int Atomic<int>::inc()
#if defined(_WINDOWS)

template <typename dataType>
inline int Atomic<dataType>::inc()
{
return _InterlockedExchangeAdd((long *)&my_storage, 1);
}
inline int Atomic<int>::dec()
template <typename dataType>
inline int Atomic<dataType>::dec()
{
return _InterlockedExchangeAdd((long *)&my_storage, -1);
}

#if defined(_WIN64)
inline size_t Atomic<size_t>::inc()
{
return _InterlockedExchangeAdd64((__int64 *)&my_storage, 1);
Expand All @@ -131,6 +135,7 @@ inline size_t Atomic<size_t>::dec()
{
return _InterlockedExchangeAdd64((__int64 *)&my_storage, -1);
}
#endif

template <typename dataType>
inline void Atomic<dataType>::set(dataType value)
Expand Down

0 comments on commit 1db36b5

Please sign in to comment.