From 8ea05274f025566c537814e0a9b354b93b27d23f Mon Sep 17 00:00:00 2001 From: Syping Date: Tue, 12 Oct 2021 01:03:17 +0200 Subject: [PATCH] fix non-Codecvt build --- src/RagePhoto.cpp | 2 ++ tests/CodecvtTest.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/RagePhoto.cpp b/src/RagePhoto.cpp index 651c261..40716b6 100644 --- a/src/RagePhoto.cpp +++ b/src/RagePhoto.cpp @@ -451,6 +451,8 @@ bool RagePhoto::save(char *data, PhotoFormat photoFormat) char photoHeader[256]; memcpy(photoHeader, photoString.data(), photoString_size); #else + const size_t photoString_size = 0; + char photoHeader[256]; std::cout << "UTF-16LE encoding support missing" << std::endl; p_error = Error::UnicodeInitError; // 4 return false; diff --git a/tests/CodecvtTest.cpp b/tests/CodecvtTest.cpp index f5adce2..83122e4 100644 --- a/tests/CodecvtTest.cpp +++ b/tests/CodecvtTest.cpp @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - std::wstring_convert,char16_t> convert; + std::wstring_convert,char16_t> convert; std::string photoString = convert.to_bytes(reinterpret_cast(photoHeader)); return strcmp(photoString.c_str(), "PHOTO - 02/01/17 08:42:44"); }