Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Apr 25, 2024
1 parent 3e9f91b commit 44766a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions Sources/Shared/IO/DeflateStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#endif

#include <algorithm>
#include <cstring>

namespace Death { namespace IO {
//###==##====#=====--==~--~=~- --- -- - - - -
Expand Down
18 changes: 11 additions & 7 deletions Sources/Shared/IO/FileStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace Death { namespace IO {
if (_handle != nullptr) {
// ::fseek return 0 on success
# if defined(DEATH_TARGET_WINDOWS)
# if defined(_LTL_Core_Version) && _LTL_Core_Version <= 4
# if defined(_Build_By_LTL)
// VC-LTL doesn't support _nolock functions
if (::_fseeki64(_handle, offset, static_cast<std::int32_t>(origin)) == 0) {
newPos = ::_ftelli64(_handle);
Expand Down Expand Up @@ -111,7 +111,7 @@ namespace Death { namespace IO {
#else
if (_handle != nullptr) {
# if defined(DEATH_TARGET_WINDOWS)
# if defined(_LTL_Core_Version) && _LTL_Core_Version <= 4
# if defined(_Build_By_LTL)
// VC-LTL doesn't support _nolock functions
pos = ::_ftelli64(_handle);
# else
Expand All @@ -137,14 +137,16 @@ namespace Death { namespace IO {
#else
if (_handle != nullptr) {
# if defined(DEATH_TARGET_WINDOWS)
# if defined(_LTL_Core_Version) && _LTL_Core_Version <= 4
# if defined(_Build_By_LTL)
// VC-LTL doesn't support _nolock functions
bytesRead = static_cast<std::int32_t>(::fread(buffer, 1, bytes, _handle));
# else
bytesRead = static_cast<std::int32_t>(::_fread_nolock(buffer, 1, bytes, _handle));
# endif
# else
# elif !defined(DEATH_TARGET_ANDROID)
bytesRead = static_cast<std::int32_t>(::fread_unlocked(buffer, 1, bytes, _handle));
# else
bytesRead = static_cast<std::int32_t>(::fread(buffer, 1, bytes, _handle));
# endif
}
#endif
Expand All @@ -163,14 +165,16 @@ namespace Death { namespace IO {
#else
if (_handle != nullptr) {
# if defined(DEATH_TARGET_WINDOWS)
# if defined(_LTL_Core_Version) && _LTL_Core_Version <= 4
# if defined(_Build_By_LTL)
// VC-LTL doesn't support _nolock functions
bytesWritten = static_cast<std::int32_t>(::fwrite(buffer, 1, bytes, _handle));
# else
bytesWritten = static_cast<std::int32_t>(::_fwrite_nolock(buffer, 1, bytes, _handle));
# endif
# else
# elif !defined(DEATH_TARGET_ANDROID)
bytesWritten = static_cast<std::int32_t>(::fwrite_unlocked(buffer, 1, bytes, _handle));
# else
bytesWritten = static_cast<std::int32_t>(::fwrite(buffer, 1, bytes, _handle));
# endif
}
#endif
Expand Down Expand Up @@ -315,7 +319,7 @@ namespace Death { namespace IO {

// Try to get file size
# if defined(DEATH_TARGET_WINDOWS)
# if defined(_LTL_Core_Version) && _LTL_Core_Version <= 4
# if defined(_Build_By_LTL)
// VC-LTL doesn't support _nolock functions
::_fseeki64(_handle, 0, SEEK_END);
_size = ::_ftelli64(_handle);
Expand Down

0 comments on commit 44766a5

Please sign in to comment.