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
3bbc5799
Commit
3bbc5799
authored
Dec 26, 2016
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MinGW build
parent
63fcfc57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
fmt/format.h
fmt/format.h
+11
-8
No files found.
fmt/format.h
View file @
3bbc5799
...
@@ -1513,15 +1513,16 @@ constexpr uint64_t make_type<void>() { return 0; }
...
@@ -1513,15 +1513,16 @@ constexpr uint64_t make_type<void>() { return 0; }
// Maximum number of arguments with packed types.
// Maximum number of arguments with packed types.
enum
{
MAX_PACKED_ARGS
=
16
};
enum
{
MAX_PACKED_ARGS
=
16
};
template
<
bool
PACKED
,
typename
Context
,
typename
T
>
template
<
bool
IS_PACKED
,
typename
Context
,
typename
T
>
inline
typename
std
::
enable_if
<
PACKED
,
Value
<
typename
Context
::
char_type
>>::
type
inline
typename
std
::
enable_if
<
IS_PACKED
,
Value
<
typename
Context
::
char_type
>>::
type
make_arg
(
const
T
&
value
)
{
make_arg
(
const
T
&
value
)
{
return
MakeValue
<
Context
>
(
value
);
return
MakeValue
<
Context
>
(
value
);
}
}
template
<
bool
PACKED
,
typename
Context
,
typename
T
>
template
<
bool
IS_
PACKED
,
typename
Context
,
typename
T
>
inline
typename
std
::
enable_if
<
inline
typename
std
::
enable_if
<
!
PACKED
,
basic_format_arg
<
typename
Context
::
char_type
>>::
type
!
IS_
PACKED
,
basic_format_arg
<
typename
Context
::
char_type
>>::
type
make_arg
(
const
T
&
value
)
{
make_arg
(
const
T
&
value
)
{
return
MakeArg
<
Context
>
(
value
);
return
MakeArg
<
Context
>
(
value
);
}
}
...
@@ -1531,22 +1532,24 @@ template <typename Context, typename ...Args>
...
@@ -1531,22 +1532,24 @@ template <typename Context, typename ...Args>
class
format_arg_store
{
class
format_arg_store
{
private:
private:
static
const
size_t
NUM_ARGS
=
sizeof
...(
Args
);
static
const
size_t
NUM_ARGS
=
sizeof
...(
Args
);
static
const
bool
PACKED
=
NUM_ARGS
<
internal
::
MAX_PACKED_ARGS
;
// Packed is a macro on MinGW so use IS_PACKED instead.
static
const
bool
IS_PACKED
=
NUM_ARGS
<
internal
::
MAX_PACKED_ARGS
;
typedef
typename
Context
::
char_type
char_type
;
typedef
typename
Context
::
char_type
char_type
;
typedef
typename
std
::
conditional
<
PACKED
,
typedef
typename
std
::
conditional
<
IS_
PACKED
,
internal
::
Value
<
char_type
>
,
basic_format_arg
<
char_type
>>::
type
value_type
;
internal
::
Value
<
char_type
>
,
basic_format_arg
<
char_type
>>::
type
value_type
;
// If the arguments are not packed, add one more element to mark the end.
// If the arguments are not packed, add one more element to mark the end.
typedef
std
::
array
<
value_type
,
NUM_ARGS
+
(
PACKED
?
0
:
1
)
>
Array
;
typedef
std
::
array
<
value_type
,
NUM_ARGS
+
(
IS_
PACKED
?
0
:
1
)
>
Array
;
Array
data_
;
Array
data_
;
public:
public:
static
const
uint64_t
TYPES
=
internal
::
make_type
<
Args
...,
void
>
();
static
const
uint64_t
TYPES
=
internal
::
make_type
<
Args
...,
void
>
();
format_arg_store
(
const
Args
&
...
args
)
format_arg_store
(
const
Args
&
...
args
)
:
data_
(
Array
{
internal
::
make_arg
<
PACKED
,
Context
>
(
args
)...})
{}
:
data_
(
Array
{
internal
::
make_arg
<
IS_
PACKED
,
Context
>
(
args
)...})
{}
const
value_type
*
data
()
const
{
return
data_
.
data
();
}
const
value_type
*
data
()
const
{
return
data_
.
data
();
}
};
};
...
...
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