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
b49a1b4a
Commit
b49a1b4a
authored
Dec 09, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linkage errors on Windows in header-only config
parent
df580969
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
format.cc
format.cc
+6
-6
No files found.
format.cc
View file @
b49a1b4a
...
...
@@ -444,7 +444,7 @@ FMT_FUNC void fmt::internal::report_unknown_type(char code, const char *type) {
#ifdef _WIN32
fmt
::
internal
::
UTF8ToUTF16
::
UTF8ToUTF16
(
fmt
::
StringRef
s
)
{
FMT_FUNC
fmt
::
internal
::
UTF8ToUTF16
::
UTF8ToUTF16
(
fmt
::
StringRef
s
)
{
int
length
=
MultiByteToWideChar
(
CP_UTF8
,
MB_ERR_INVALID_CHARS
,
s
.
c_str
(),
-
1
,
0
,
0
);
static
const
char
ERROR
[]
=
"cannot convert string from UTF-8 to UTF-16"
;
...
...
@@ -457,14 +457,14 @@ fmt::internal::UTF8ToUTF16::UTF8ToUTF16(fmt::StringRef s) {
FMT_THROW
(
WindowsError
(
GetLastError
(),
ERROR
));
}
fmt
::
internal
::
UTF16ToUTF8
::
UTF16ToUTF8
(
fmt
::
WStringRef
s
)
{
FMT_FUNC
fmt
::
internal
::
UTF16ToUTF8
::
UTF16ToUTF8
(
fmt
::
WStringRef
s
)
{
if
(
int
error_code
=
convert
(
s
))
{
FMT_THROW
(
WindowsError
(
error_code
,
"cannot convert string from UTF-16 to UTF-8"
));
}
}
int
fmt
::
internal
::
UTF16ToUTF8
::
convert
(
fmt
::
WStringRef
s
)
{
FMT_FUNC
int
fmt
::
internal
::
UTF16ToUTF8
::
convert
(
fmt
::
WStringRef
s
)
{
int
length
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
s
.
c_str
(),
-
1
,
0
,
0
,
0
,
0
);
if
(
length
==
0
)
return
GetLastError
();
...
...
@@ -476,7 +476,7 @@ int fmt::internal::UTF16ToUTF8::convert(fmt::WStringRef s) {
return
0
;
}
void
fmt
::
WindowsError
::
init
(
FMT_FUNC
void
fmt
::
WindowsError
::
init
(
int
error_code
,
StringRef
format_str
,
ArgList
args
)
{
error_code_
=
error_code
;
MemoryWriter
w
;
...
...
@@ -509,7 +509,7 @@ FMT_FUNC void fmt::internal::format_system_error(
}
#ifdef _WIN32
void
fmt
::
internal
::
format_windows_error
(
FMT_FUNC
void
fmt
::
internal
::
format_windows_error
(
fmt
::
Writer
&
out
,
int
error_code
,
fmt
::
StringRef
message
)
FMT_NOEXCEPT
(
true
)
{
class
String
{
...
...
@@ -1069,7 +1069,7 @@ FMT_FUNC void fmt::report_system_error(
}
#ifdef _WIN32
void
fmt
::
report_windows_error
(
FMT_FUNC
void
fmt
::
report_windows_error
(
int
error_code
,
fmt
::
StringRef
message
)
FMT_NOEXCEPT
(
true
)
{
report_error
(
internal
::
format_windows_error
,
error_code
,
message
);
}
...
...
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