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

check for win desktop app #2629

Closed
wants to merge 1 commit into from
Closed

Conversation

Acretock
Copy link
Contributor

@Acretock Acretock commented Dec 3, 2021

Should fix this #2628
this should checks for Windows desktop app, and disable for UWP, wich dont support _tzset

@Acretock
Copy link
Contributor Author

Acretock commented Dec 3, 2021

found about this check in this

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

@@ -878,7 +878,7 @@ template <typename T>
struct has_member_data_tm_gmtoff<T, void_t<decltype(T::tm_gmtoff)>>
: std::true_type {};

#if defined(_WIN32)
#if defined(_WIN32) && (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's merge tzset_once into format_utc_offset_impl to avoid repeating the check and since it's only used there.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vitaut, after the proposed merge the _tzset function will be called multiple times. Once for each tm_writer template instantiation.
It won't throw an error. But there may be a slowdown if present many tm_writer template instantiation with differents args.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, let's keep this function but introduce a macro FMT_USE_TZSET instead to avoid repetition.

@vitaut
Copy link
Contributor

vitaut commented Dec 7, 2021

Closing in favor of #2633.

@vitaut vitaut closed this Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants