mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-08 06:00:45 -07:00
Add CMake project, GCC support (#540)
This is extract from #211 that enables compilation with GCC. With #211 now in the state of bitrot, I would rather try approaching it in smaller steps that can be hopefully merged quicker, even if it does not provide full support for all the features #211 provided. This will _compile_ correctly with my (@janisozaur) GCC, but clang is more picky about flexible array members and refuses to compile it yet. I will extract remaining parts of #211 in future PRs. I marked @fwcd as author, as he did most of the work in #211.
This commit is contained in:
parent
98f1da2e9d
commit
fe30c7cabc
19 changed files with 151 additions and 50 deletions
|
@ -191,7 +191,7 @@ void CurrencyDataLoader::LoadData()
|
|||
if (!LoadFinished())
|
||||
{
|
||||
create_task([this]() -> task<bool> {
|
||||
vector<function<task<bool>()>> loadFunctions = {
|
||||
vector<function<future<bool>()>> loadFunctions = {
|
||||
[this]() { return TryLoadDataFromCacheAsync(); },
|
||||
[this]() { return TryLoadDataFromWebAsync(); },
|
||||
};
|
||||
|
@ -307,7 +307,7 @@ pair<wstring, wstring> CurrencyDataLoader::GetCurrencyRatioEquality(_In_ const U
|
|||
}
|
||||
|
||||
#pragma optimize("", off) // Turn off optimizations to work around DevDiv 393321
|
||||
task<bool> CurrencyDataLoader::TryLoadDataFromCacheAsync()
|
||||
future<bool> CurrencyDataLoader::TryLoadDataFromCacheAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -349,7 +349,7 @@ task<bool> CurrencyDataLoader::TryLoadDataFromCacheAsync()
|
|||
}
|
||||
}
|
||||
|
||||
task<bool> CurrencyDataLoader::TryFinishLoadFromCacheAsync()
|
||||
future<bool> CurrencyDataLoader::TryFinishLoadFromCacheAsync()
|
||||
{
|
||||
auto localSettings = ApplicationData::Current->LocalSettings;
|
||||
if (localSettings == nullptr)
|
||||
|
@ -386,7 +386,7 @@ task<bool> CurrencyDataLoader::TryFinishLoadFromCacheAsync()
|
|||
co_return true;
|
||||
}
|
||||
|
||||
task<bool> CurrencyDataLoader::TryLoadDataFromWebAsync()
|
||||
future<bool> CurrencyDataLoader::TryLoadDataFromWebAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -459,7 +459,7 @@ task<bool> CurrencyDataLoader::TryLoadDataFromWebAsync()
|
|||
}
|
||||
}
|
||||
|
||||
task<bool> CurrencyDataLoader::TryLoadDataFromWebOverrideAsync()
|
||||
future<bool> CurrencyDataLoader::TryLoadDataFromWebOverrideAsync()
|
||||
{
|
||||
m_meteredOverrideSet = true;
|
||||
bool didLoad = co_await TryLoadDataFromWebAsync();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue