Skip to content
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
1 change: 1 addition & 0 deletions cppwinrt/pch.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <utility>
#include "cmd_reader.h"
#include <winmd_reader.h>
#include "task_group.h"
Expand Down
1 change: 1 addition & 0 deletions cppwinrt/text_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <sstream>
#include <string>
#include <string_view>
#include <vector>

namespace cppwinrt
{
Expand Down
2 changes: 1 addition & 1 deletion strings/base_chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ WINRT_EXPORT namespace winrt

static time_point from_time_t(time_t time) noexcept
{
return from_sys(std::chrono::system_clock::from_time_t(time));
return std::chrono::time_point_cast<duration>(from_sys(std::chrono::system_clock::from_time_t(time)));
}

static file_time to_file_time(time_point const& time) noexcept
Expand Down
9 changes: 8 additions & 1 deletion strings/base_includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <charconv>
#include <chrono>
#include <cstddef>
#include <cstring>
#include <iterator>
#include <map>
#include <memory>
Expand All @@ -20,6 +21,10 @@
#include <utility>
#include <vector>

#if __has_include(<version>)
#include <version>
#endif

#if __has_include(<windowsnumerics.impl.h>)
#define WINRT_IMPL_NUMERICS
#include <directxmath.h>
Expand Down Expand Up @@ -50,7 +55,7 @@ namespace winrt::impl
using suspend_never = std::suspend_never;
}

#else
#elif __has_include(<experimental/coroutine>)

#include <experimental/coroutine>

Expand All @@ -63,4 +68,6 @@ namespace winrt::impl
using suspend_never = std::experimental::suspend_never;
}

#else
#error C++/WinRT requires coroutine support, which is currently missing. Try enabling C++20 in your compiler.
#endif
4 changes: 2 additions & 2 deletions strings/base_string_operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ WINRT_EXPORT namespace winrt
return left < std::wstring_view(right);
}

bool operator<(hstring const& left, nullptr_t) = delete;
bool operator<(hstring const& left, std::nullptr_t) = delete;

bool operator<(nullptr_t, hstring const& right) = delete;
bool operator<(std::nullptr_t, hstring const& right) = delete;
inline bool operator!=(hstring const& left, hstring const& right) noexcept { return !(left == right); }
inline bool operator>(hstring const& left, hstring const& right) noexcept { return right < left; }
inline bool operator<=(hstring const& left, hstring const& right) noexcept { return !(right < left); }
Expand Down