Skip to content

Commit

Permalink
Don't sanitize gtest, use permissive- on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMax committed Dec 28, 2023
1 parent c8dbfd9 commit 977bd56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
18 changes: 13 additions & 5 deletions include/lexio/bufwriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,20 @@ class FixedBufWriter

WRITER &&Writer() && { return std::move(m_wrapped); }

size_t LexRead(uint8_t *outDest, const size_t count) { return Read<WRITER>(m_wrapped, outDest, count); }
std::enable_if_t<IsReaderV<WRITER>, size_t> LexRead(uint8_t *outDest, const size_t count)
{
return Read<WRITER>(m_wrapped, outDest, count);
}

BufferView LexFillBuffer(const size_t count) { return FillBuffer<WRITER>(m_wrapped, count); }
std::enable_if_t<IsBufferedReaderV<WRITER>, BufferView> LexFillBuffer(const size_t count)
{
return FillBuffer<WRITER>(m_wrapped, count);
}

void LexConsumeBuffer(const size_t count) { ConsumeBuffer<WRITER>(m_wrapped, count); }
std::enable_if_t<IsBufferedReaderV<WRITER>, void> LexConsumeBuffer(const size_t count)
{
ConsumeBuffer<WRITER>(m_wrapped, count);
}

size_t LexWrite(const uint8_t *src, const size_t count)
{
Expand Down Expand Up @@ -99,8 +108,7 @@ class FixedBufWriter
Flush<WRITER>(m_wrapped);
}

template <typename = std::enable_if_t<IsSeekableV<WRITER>>>
size_t LexSeek(const SeekPos pos)
std::enable_if_t<IsSeekableV<WRITER>, size_t> LexSeek(const SeekPos pos)
{
LexFlush();
return Seek<WRITER>(m_wrapped, pos);
Expand Down
8 changes: 1 addition & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,8 @@ if(WERROR_CXX20_EXTENSIONS)
target_compile_options(lexio_test PRIVATE "-Werror=c++20-extensions")
endif()

add_sanitizers(Catch2)
if(MSVC AND SANITIZE_ADDRESS)
target_compile_definitions(Catch2 PUBLIC "_DISABLE_VECTOR_ANNOTATION")
target_compile_definitions(Catch2 PUBLIC "_DISABLE_STRING_ANNOTATION")
endif()

if(MSVC)
target_compile_options(lexio_test PUBLIC /W4 /D_DISABLE_VECTOR_ANNOTATION)
target_compile_options(lexio_test PUBLIC /W4 /permissive-)
else()
target_compile_options(lexio_test PUBLIC -Wall -Wextra -Wno-unknown-pragmas)
endif()
Expand Down

0 comments on commit 977bd56

Please sign in to comment.