Fix MSVC build

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2023-05-09 00:34:08 +02:00
parent f782294135
commit 0a563b8150
No known key found for this signature in database
GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 14 additions and 2 deletions

View File

@ -705,7 +705,7 @@ static int64_t getTimeInMicroseconds() noexcept
#if defined(_MSC_VER)
struct _timeb tb;
_ftime_s (&tb);
return ((int64) tb.time) * 1000 + tb.millitm;
return ((int64_t) tb.time) * 1000 + tb.millitm;
#elif defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)
struct timeval tv;
gettimeofday(&tv, nullptr);

View File

@ -344,7 +344,19 @@ inline uint32 Atomic<uint32>::operator--() noexcept
return castFromLong (_InterlockedDecrement (reinterpret_cast<volatile long*> (&value)));
}
# ifdef CARLA_OS_64BIT
# ifndef CARLA_OS_64BIT
template <>
inline int64 Atomic<int64>::exchange (const int64 newValue) noexcept
{
return castFrom64Bit (_InterlockedCompareExchange64 (reinterpret_cast<volatile int64*> (&value), castTo64Bit (value), castTo64Bit (newValue)));
}
template <>
inline uint64 Atomic<uint64>::exchange (const uint64 newValue) noexcept
{
return castFrom64Bit (_InterlockedCompareExchange64 (reinterpret_cast<volatile int64*> (&value), castTo64Bit (value), castTo64Bit (newValue)));
}
# else
template <>
inline int64 Atomic<int64>::exchange (const int64 newValue) noexcept
{