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
6eaa5074
Commit
6eaa5074
authored
Jul 18, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix global initialization issue (#807)
parent
48dff9f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
include/fmt/core.h
include/fmt/core.h
+17
-7
No files found.
include/fmt/core.h
View file @
6eaa5074
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
# define FMT_MSC_VER 0
# define FMT_MSC_VER 0
#endif
#endif
// Check if relaxed
c
++14 constexpr is supported.
// Check if relaxed
C
++14 constexpr is supported.
// GCC doesn't allow throw in constexpr until version 6 (bug 67371).
// GCC doesn't allow throw in constexpr until version 6 (bug 67371).
#ifndef FMT_USE_CONSTEXPR
#ifndef FMT_USE_CONSTEXPR
# define FMT_USE_CONSTEXPR \
# define FMT_USE_CONSTEXPR \
...
@@ -69,6 +69,16 @@
...
@@ -69,6 +69,16 @@
# define FMT_CONSTEXPR_DECL
# define FMT_CONSTEXPR_DECL
#endif
#endif
#ifndef FMT_USE_CONSTEXPR11
# define FMT_USE_CONSTEXPR11 \
(FMT_MSC_VER >= 1900 || FMT_GCC_VERSION >= 406 || FMT_USE_CONSTEXPR)
#endif
#if FMT_USE_CONSTEXPR11
# define FMT_CONSTEXPR11 constexpr
#else
# define FMT_CONSTEXPR11
#endif
#ifndef FMT_OVERRIDE
#ifndef FMT_OVERRIDE
# if FMT_HAS_FEATURE(cxx_override) || \
# if FMT_HAS_FEATURE(cxx_override) || \
(FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900
(FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900
...
@@ -957,10 +967,10 @@ struct get_type {
...
@@ -957,10 +967,10 @@ struct get_type {
};
};
template
<
typename
Context
>
template
<
typename
Context
>
FMT_CONSTEXPR
unsigned
long
long
get_types
()
{
return
0
;
}
FMT_CONSTEXPR
11
unsigned
long
long
get_types
()
{
return
0
;
}
template
<
typename
Context
,
typename
Arg
,
typename
...
Args
>
template
<
typename
Context
,
typename
Arg
,
typename
...
Args
>
FMT_CONSTEXPR
unsigned
long
long
get_types
()
{
FMT_CONSTEXPR
11
unsigned
long
long
get_types
()
{
return
get_type
<
Context
,
Arg
>::
value
|
(
get_types
<
Context
,
Args
...
>
()
<<
4
);
return
get_type
<
Context
,
Arg
>::
value
|
(
get_types
<
Context
,
Args
...
>
()
<<
4
);
}
}
...
@@ -1010,15 +1020,15 @@ class format_arg_store {
...
@@ -1010,15 +1020,15 @@ class format_arg_store {
friend
class
basic_format_args
<
Context
>
;
friend
class
basic_format_args
<
Context
>
;
static
FMT_CONSTEXPR
long
long
get_types
()
{
static
FMT_CONSTEXPR
11
long
long
get_types
()
{
return
IS_PACKED
?
return
IS_PACKED
?
static_cast
<
long
long
>
(
internal
::
get_types
<
Context
,
Args
...
>
())
:
static_cast
<
long
long
>
(
internal
::
get_types
<
Context
,
Args
...
>
())
:
-
static_cast
<
long
long
>
(
NUM_ARGS
);
-
static_cast
<
long
long
>
(
NUM_ARGS
);
}
}
public:
public:
#if FMT_USE_CONSTEXPR
#if FMT_USE_CONSTEXPR
11
static
constexpr
long
long
TYPES
=
get_types
();
static
FMT_CONSTEXPR11
long
long
TYPES
=
get_types
();
#else
#else
static
const
long
long
TYPES
;
static
const
long
long
TYPES
;
#endif
#endif
...
@@ -1037,7 +1047,7 @@ class format_arg_store {
...
@@ -1037,7 +1047,7 @@ class format_arg_store {
#endif
#endif
};
};
#if !FMT_USE_CONSTEXPR
#if !FMT_USE_CONSTEXPR
11
template
<
typename
Context
,
typename
...
Args
>
template
<
typename
Context
,
typename
...
Args
>
const
long
long
format_arg_store
<
Context
,
Args
...
>::
TYPES
=
get_types
();
const
long
long
format_arg_store
<
Context
,
Args
...
>::
TYPES
=
get_types
();
#endif
#endif
...
...
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