Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[date] Update to HEAD versioning #39465

Merged
merged 1 commit into from
Jun 27, 2024
Merged
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
87 changes: 82 additions & 5 deletions ports/date/0001-fix-uwp.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git i/include/date/date.h w/include/date/date.h
index fce6200..6a77ad4 100644
--- i/include/date/date.h
+++ w/include/date/date.h
@@ -82,7 +82,7 @@
diff --git a/include/date/date.h b/include/date/date.h
index beb627e..ba48515 100644
--- a/include/date/date.h
+++ b/include/date/date.h
@@ -81,7 +81,7 @@
#ifdef _MSC_VER
# pragma warning(push)
// warning C4127: conditional expression is constant
Expand All @@ -11,3 +11,80 @@ index fce6200..6a77ad4 100644
#endif

namespace date
diff --git a/src/tz.cpp b/src/tz.cpp
index 82e4312..9481afa 100644
--- a/src/tz.cpp
+++ b/src/tz.cpp
@@ -202,35 +202,6 @@ namespace
using co_task_mem_ptr = std::unique_ptr<wchar_t[], task_mem_deleter>;
}

-static
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does moving this function down fix UWP?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was moved out the #ifdef !WINRT section so it compiles also on UWP.

-std::wstring
-convert_utf8_to_utf16(const std::string& s)
-{
- std::wstring out;
- const int size = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, NULL, 0);
-
- if (size == 0)
- {
- std::string msg = "Failed to determine required size when converting \"";
- msg += s;
- msg += "\" to UTF-16.";
- throw std::runtime_error(msg);
- }
-
- out.resize(size);
- const int check = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, &out[0], size);
-
- if (size != check)
- {
- std::string msg = "Failed to convert \"";
- msg += s;
- msg += "\" to UTF-16.";
- throw std::runtime_error(msg);
- }
-
- return out;
-}
-
// We might need to know certain locations even if not using the remote API,
// so keep these routines out of that block for now.
static
@@ -268,6 +239,36 @@ get_download_folder()
# endif // !INSTALL

# endif // WINRT
+
+static
+std::wstring
+convert_utf8_to_utf16(const std::string& s)
+{
+ std::wstring out;
+ const int size = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, NULL, 0);
+
+ if (size == 0)
+ {
+ std::string msg = "Failed to determine required size when converting \"";
+ msg += s;
+ msg += "\" to UTF-16.";
+ throw std::runtime_error(msg);
+ }
+
+ out.resize(size);
+ const int check = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, &out[0], size);
+
+ if (size != check)
+ {
+ std::string msg = "Failed to convert \"";
+ msg += s;
+ msg += "\" to UTF-16.";
+ throw std::runtime_error(msg);
+ }
+
+ return out;
+}
+
# else // !_WIN32

# if !defined(INSTALL)
40 changes: 0 additions & 40 deletions ports/date/fix-uninitialized-values.patch

This file was deleted.

5 changes: 2 additions & 3 deletions ports/date/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO HowardHinnant/date
REF "v${VERSION}"
SHA512 6bdc7cba821d66e17a559250cc0ce0095808e9db81cec9e16eaa4c31abdfa705299c67b72016d9b06b302bc306d063e83a374eb00728071b83a5ad650d59034f
REF 1ead6715dec030d340a316c927c877a3c4e5a00c
SHA512 a0b5dd2d94788929a2ba98bd629d64d188ff0ae40affd9338d3d7a94c848ae4d6addc72613964e7fad7f62e4ee20b7170b2133cb39d4e018c604ba35c68d1cff
HEAD_REF master
PATCHES
0001-fix-uwp.patch
0002-fix-cmake-install.patch
fix-uninitialized-values.patch #Update the new version please remove this patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
3 changes: 1 addition & 2 deletions ports/date/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "date",
"version": "3.0.1",
"port-version": 5,
"version-date": "2024-05-14",
"description": "A date and time library based on the C++17 <chrono> header",
"homepage": "https://github.com/HowardHinnant/date",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2161,8 +2161,8 @@
"port-version": 0
},
"date": {
"baseline": "3.0.1",
"port-version": 5
"baseline": "2024-05-14",
"port-version": 0
},
"datraw": {
"baseline": "1.0.9",
Expand Down
5 changes: 5 additions & 0 deletions versions/d-/date.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "52f7b2f3a6398c0aa4a073a06c55c1a513b478bb",
"version-date": "2024-05-14",
"port-version": 0
},
{
"git-tree": "cf7d19c233055e8ffa12b200af6afb894ed76447",
"version": "3.0.1",
Expand Down