aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-05-26 07:25:35 +0200
committerSven Göthel <[email protected]>2024-05-26 07:25:35 +0200
commit9a69284d4fb2e9130fd60e3c03005d10d1b8638f (patch)
tree271e91d06c87acd4511f21f516bd5c1d8185af45
parentbc2c32ecb086c76c4544b2a7c080cdf49cece4ae (diff)
emscripted/32-bit: Avoid dead-code comparison (error)
-rw-r--r--src/byte_stream.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/byte_stream.cpp b/src/byte_stream.cpp
index 82403fe..127c857 100644
--- a/src/byte_stream.cpp
+++ b/src/byte_stream.cpp
@@ -30,6 +30,7 @@
// #include <botan_all.h>
+#include <jau/cpuid.hpp>
#include <jau/debug.hpp>
#include <jau/byte_stream.hpp>
@@ -209,7 +210,8 @@ size_t ByteInStream_File::read(void* out, size_t length) noexcept {
}
size_t ByteInStream_File::peek(void* out, size_t length, size_t offset) noexcept {
- if( 0 == length || !good() || offset > std::numeric_limits<off64_t>::max() ||
+ if( 0 == length || !good() ||
+ ( sizeof(size_t) >= sizeof(off64_t) && offset > std::numeric_limits<off64_t>::max() ) ||
( m_has_content_length && m_content_size - m_bytes_consumed < offset + 1 /* min number of bytes to read */ ) ) {
return 0;
}