Skip to content

Commit

Permalink
(#24526) [aws-crt-cpp] Fix build on Windows with C++20
Browse files Browse the repository at this point in the history
* [aws-crt-cpp] Fix build on Windows with C++20

* Fix patch_type and add patch_source

* newline at eol

* Apply patch for .1a version

---------

Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es>
  • Loading branch information
jeremy-coulon and AbrilRBS authored Aug 21, 2024
1 parent 91adbc6 commit ae4ceb7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipes/aws-crt-cpp/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ sources:
"0.17.1a":
url: "https://github.com/awslabs/aws-crt-cpp/archive/v0.17.1a.tar.gz"
sha256: "64053c8237e350cfbec24984a3696aaf914bfa64e6200ef19bebe9cf5bb0692b"
patches:
"0.17.1a":
- patch_file: "patches/0.17.23-fix-cpp20-windows.patch"
patch_description: "Fixes cpp 20 builds for windows."
patch_type: "bugfix"
patch_source: "https://github.com/awslabs/aws-crt-cpp/pull/364"
28 changes: 28 additions & 0 deletions recipes/aws-crt-cpp/all/patches/0.17.23-fix-cpp20-windows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 3216ce53fa7f276ae4407a450cafafa9e809fea1 Mon Sep 17 00:00:00 2001
From: Sam Bisciglia <sbiscigl@asu.edu>
Date: Tue, 12 Apr 2022 14:42:26 -0400
Subject: [PATCH] Fixes cpp 20 builds for windows. (#364)

---
diff --git a/include/aws/crt/StringView.h b/include/aws/crt/StringView.h
index a0fec83..dc2f05b 100644
--- a/include/aws/crt/StringView.h
+++ b/include/aws/crt/StringView.h
@@ -15,7 +15,7 @@
#include <stddef.h>
#include <type_traits>

-#if __cplusplus >= 201703L || (defined(_MSC_LANG) && _MSC_LANG >= 201703L)
+#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
# include <string_view>
#endif

@@ -53,7 +53,7 @@ namespace Aws

basic_string_view &operator=(const basic_string_view &) noexcept = default;

-#if __cplusplus >= 201703L || (defined(_MSC_LANG) && _MSC_LANG >= 201703L)
+#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
constexpr basic_string_view(const std::basic_string_view<CharT, Traits> &other) noexcept
: m_size(other.size()), m_data(other.data())
{

0 comments on commit ae4ceb7

Please sign in to comment.