aboutsummaryrefslogtreecommitdiff
path: root/src/chips/dosbox
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2020-10-14 10:50:41 +0300
committerWohlstand <admin@wohlnet.ru>2020-10-14 10:50:41 +0300
commit72f68a25c9825fe48750376c56d2fdc6d014fddc (patch)
tree10347784a6f7fcce93fa64320ab8c4510965b153 /src/chips/dosbox
parent736df6495ba6e80dad46e058140bf0693819f3bd (diff)
downloadlibADLMIDI-72f68a25c9825fe48750376c56d2fdc6d014fddc.tar.gz
libADLMIDI-72f68a25c9825fe48750376c56d2fdc6d014fddc.tar.bz2
libADLMIDI-72f68a25c9825fe48750376c56d2fdc6d014fddc.zip
DosBox: keep own smart pointer
Because of MSVC that doesn't gives the proper value for __cplusplus without of the `/Zc:__cplusplus` argument, make just use of hand-made pointer to allow users to build library's code easier
Diffstat (limited to 'src/chips/dosbox')
-rw-r--r--src/chips/dosbox/dbopl.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/chips/dosbox/dbopl.cpp b/src/chips/dosbox/dbopl.cpp
index 5b4bf53..c5a7024 100644
--- a/src/chips/dosbox/dbopl.cpp
+++ b/src/chips/dosbox/dbopl.cpp
@@ -41,6 +41,7 @@
#include <memory>
#include "dbopl.h"
#include "../common/mutex.hpp"
+#include "../common/ptr.hpp"
#if defined(__GNUC__) && __GNUC__ > 3
#define INLINE inline __attribute__((__always_inline__))
@@ -1353,11 +1354,7 @@ static const CacheEntry &ComputeRateDependent( Bit32u rate )
double original = OPLRATE;
double scale = original / (double)rate;
-#if __cplusplus >= 201103L
- std::unique_ptr<CacheEntry> entry(new CacheEntry);
-#else
- std::auto_ptr<CacheEntry> entry(new CacheEntry);
-#endif
+ My_UPtr<CacheEntry> entry(new CacheEntry);
entry->rate = rate;
Bit32u *freqMul = entry->freqMul;
Bit32u *linearRates = entry->linearRates;
@@ -1438,8 +1435,8 @@ static const CacheEntry &ComputeRateDependent( Bit32u rate )
}
MutexHolder lock( cache.mutex );
- if (const CacheEntry *entry = CacheLookupRateDependent( rate ))
- return *entry;
+ if (const CacheEntry *e = CacheLookupRateDependent( rate ))
+ return *e;
cache.entries.push_back(entry.get());
return *entry.release();