Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
9d5b9def
Unverified
Commit
9d5b9def
authored
Dec 08, 2021
by
Vladislav Shchapov
Committed by
GitHub
Dec 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable tzset only on Windows desktop app (#2633)
parent
215f21a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
include/fmt/chrono.h
include/fmt/chrono.h
+17
-1
No files found.
include/fmt/chrono.h
View file @
9d5b9def
...
...
@@ -20,6 +20,20 @@
FMT_BEGIN_NAMESPACE
// Enable tzset.
#ifndef FMT_USE_TZSET
// UWP doesn't provide _tzset.
# if FMT_HAS_INCLUDE("winapifamily.h")
# include <winapifamily.h>
# endif
# if defined(_WIN32) && (!defined(WINAPI_FAMILY) || \
(WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
# define FMT_USE_TZSET 1
# else
# define FMT_USE_TZSET 0
# endif
#endif
// Enable safe chrono durations, unless explicitly disabled.
#ifndef FMT_SAFE_DURATION_CAST
# define FMT_SAFE_DURATION_CAST 1
...
...
@@ -924,7 +938,7 @@ template <typename T>
struct
has_member_data_tm_zone
<
T
,
void_t
<
decltype
(
T
::
tm_zone
)
>>
:
std
::
true_type
{};
#if
defined(_WIN32)
#if
FMT_USE_TZSET
inline
void
tzset_once
()
{
static
bool
init
=
[]()
->
bool
{
_tzset
();
...
...
@@ -1067,7 +1081,9 @@ template <typename OutputIt, typename Char> class tm_writer {
}
void
format_utc_offset_impl
(
std
::
false_type
)
{
#if defined(_WIN32)
# if FMT_USE_TZSET
tzset_once
();
# endif
long
offset
=
0
;
_get_timezone
(
&
offset
);
if
(
tm_
.
tm_isdst
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment