Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions ports/cpprestsdk/chart_traits.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
diff --git a/Release/include/cpprest/char_traits.h b/Release/include/cpprest/char_traits.h
new file mode 100644
index 00000000..ba9ef01e
--- /dev/null
+++ b/Release/include/cpprest/char_traits.h
@@ -0,0 +1,82 @@
+#pragma once
+
+#include <cstddef>
+
+#if (_LIBCPP_VERSION >= 190000)
+
+#include <cstdint>
+#include <cstring>
+#include <string>
+
+namespace std
+{
+template<>
+struct char_traits<uint8_t>
+{
+ using char_type = uint8_t;
+ using int_type = unsigned int;
+ using off_type = std::streamoff;
+ using pos_type = std::streampos;
+ using state_type = std::mbstate_t;
+
+ static void assign(char_type& c1, const char_type& c2) noexcept { c1 = c2; }
+
+ static bool eq(char_type c1, char_type c2) noexcept { return c1 == c2; }
+
+ static bool lt(char_type c1, char_type c2) noexcept { return c1 < c2; }
+
+ static int compare(const char_type* s1, const char_type* s2, std::size_t n) noexcept
+ {
+ return std::memcmp(s1, s2, n);
+ }
+
+ static std::size_t length(const char_type* s) noexcept
+ {
+ const char_type* p = s;
+ while (*p != 0)
+ ++p;
+ return p - s;
+ }
+
+ static const char_type* find(const char_type* s, std::size_t n, const char_type& a) noexcept
+ {
+ for (std::size_t i = 0; i < n; ++i)
+ {
+ if (eq(s[i], a))
+ {
+ return s + i;
+ }
+ }
+
+ return nullptr;
+ }
+
+ static char_type* move(char_type* s1, const char_type* s2, std::size_t n) noexcept
+ {
+ return static_cast<char_type*>(std::memmove(s1, s2, n));
+ }
+
+ static char_type* copy(char_type* s1, const char_type* s2, std::size_t n) noexcept
+ {
+ return static_cast<char_type*>(std::memcpy(s1, s2, n));
+ }
+
+ static char_type* assign(char_type* s, std::size_t n, char_type a) noexcept
+ {
+ std::fill_n(s, n, a);
+ return s;
+ }
+
+ static int_type not_eof(int_type c) noexcept { return c == eof() ? ~eof() : c; }
+
+ static char_type to_char_type(int_type c) noexcept { return static_cast<char_type>(c); }
+
+ static int_type to_int_type(char_type c) noexcept { return static_cast<int_type>(c); }
+
+ static bool eq_int_type(int_type c1, int_type c2) noexcept { return c1 == c2; }
+
+ static int_type eof() noexcept { return static_cast<int_type>(-1); }
+};
+} // namespace std
+
+#endif // (_LIBCPP_VERSION >= 190000)
diff --git a/Release/include/cpprest/streams.h b/Release/include/cpprest/streams.h
index b6c38640..704bfc92 100644
--- a/Release/include/cpprest/streams.h
+++ b/Release/include/cpprest/streams.h
@@ -15,6 +15,7 @@
#ifndef CASA_STREAMS_H
#define CASA_STREAMS_H

+#include "cpprest/char_traits.h"
#include "cpprest/astreambuf.h"
#include <iosfwd>
#include <cstdio>
1 change: 1 addition & 0 deletions ports/cpprestsdk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ vcpkg_from_github(
fix-clang-dllimport.patch # workaround for https://github.com/microsoft/cpprestsdk/issues/1710
silence-stdext-checked-array-iterators-warning.patch
fix-asio-error.patch
chart_traits.patch # remove after https://github.com/microsoft/cpprestsdk/pull/1820
)

vcpkg_check_features(
Expand Down
2 changes: 1 addition & 1 deletion ports/cpprestsdk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cpprestsdk",
"version": "2.10.19",
"port-version": 3,
"port-version": 4,
"description": [
"C++11 JSON, REST, and OAuth library",
"The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services."
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,7 @@
},
"cpprestsdk": {
"baseline": "2.10.19",
"port-version": 3
"port-version": 4
},
"cppslippi": {
"baseline": "1.4.3.16",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cpprestsdk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "938096ad282071faff4b7b5746dd3193ad95c408",
"version": "2.10.19",
"port-version": 4
},
{
"git-tree": "9f5e160191038cbbd2470e534c43f051c80e7d44",
"version": "2.10.19",
Expand Down