diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe5238384..2358eeff8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,6 +232,8 @@ jobs: - uses: actions/setup-python@v6 - name: Install meson run: pip install meson + - name: Setup MSVC environment + uses: ilammy/msvc-dev-cmd@v1 - name: Checkout uses: actions/checkout@v5 - name: "Build & Test" @@ -239,7 +241,6 @@ jobs: CMAKE_GENERATOR: "Visual Studio 17 2022" CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: OFF - CURL_USE_LIBPSL: OFF uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build @@ -254,6 +255,8 @@ jobs: - uses: actions/setup-python@v6 - name: Install meson run: pip install meson + - name: Setup MSVC environment + uses: ilammy/msvc-dev-cmd@v1 - name: Install OpenSSL run: choco install openssl -y - name: Checkout @@ -264,7 +267,6 @@ jobs: CPR_BUILD_TESTS: ON CPR_BUILD_TESTS_SSL: ON CPR_FORCE_OPENSSL_BACKEND: ON - CURL_USE_LIBPSL: OFF uses: ashutoshvarma/action-cmake-build@master with: build-dir: ${{ github.workspace }}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f24da216..152bf9318 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(cpr VERSION 1.14.0 LANGUAGES CXX) +project(cpr VERSION 1.14.1 LANGUAGES CXX) math(EXPR cpr_VERSION_NUM "${cpr_VERSION_MAJOR} * 0x10000 + ${cpr_VERSION_MINOR} * 0x100 + ${cpr_VERSION_PATCH}" OUTPUT_FORMAT HEXADECIMAL) configure_file("${cpr_SOURCE_DIR}/cmake/cprver.h.in" "${cpr_BINARY_DIR}/cpr_generated_includes/cpr/cprver.h") diff --git a/cpr/sse.cpp b/cpr/sse.cpp index c352fae35..05ab06fe8 100644 --- a/cpr/sse.cpp +++ b/cpr/sse.cpp @@ -1,12 +1,12 @@ #include "cpr/sse.h" #include -#include #include #include #include #include #include +#include namespace cpr { @@ -87,7 +87,9 @@ bool ServerSentEventParser::processLine(const std::string& line, const std::func // Parse retry value as integer size_t retry_value = 0; const std::string_view sv(value); - auto [ptr, ec] = std::from_chars(sv.begin(), sv.end(), retry_value); + const char* begin = sv.data(); + const char* end = begin + sv.size(); // NOLINT (cppcoreguidelines-pro-bounds-pointer-arithmetic) Required here since Windows and Clang/GCC have different std::string_view iterator implementations + auto [ptr, ec] = std::from_chars(begin, end, retry_value); if (ec == std::errc()) { current_event_.retry = retry_value; }