mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed: shared_ptr vs. unique_ptr behavior in VS2013
This commit is contained in:
parent
cac70762f5
commit
99c04d0ed3
@ -41,7 +41,12 @@ namespace ace {
|
||||
if (in.eof()) {
|
||||
in.clear();
|
||||
}
|
||||
_data = std::unique_ptr<uint8_t[]>(new uint8_t[expected_size + (expected_size % 8)]);
|
||||
#if _MSC_VER == 1800
|
||||
_data = std::make_shared<uint8_t[]>(expected_size + (expected_size % 8));
|
||||
#else
|
||||
_data = std::make_unique<uint8_t[]>(expected_size + (expected_size % 8));
|
||||
#endif
|
||||
|
||||
result = _mikero_lzo1x_decompress_safe(buffer, _data.get(), expected_size);
|
||||
if (result < 0) {
|
||||
LOG(ERROR) << "Decompression failed";
|
||||
|
@ -12,7 +12,11 @@ namespace ace {
|
||||
protected:
|
||||
int _mikero_lzo1x_decompress_safe(const uint8_t*, uint8_t*, uint32_t);
|
||||
int _decompress_safe(std::istream &, uint32_t);
|
||||
#if _MSC_VER == 1800
|
||||
std::shared_ptr<uint8_t[]> _data;
|
||||
#else
|
||||
std::unique_ptr<uint8_t[]> _data;
|
||||
#endif
|
||||
};
|
||||
template<typename T>
|
||||
class compressed_base : public _compressed_base {
|
||||
|
Loading…
Reference in New Issue
Block a user