Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
3e516699
Commit
3e516699
authored
Dec 08, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed global #defines from format.cc
parent
d817994b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
format.cc
include/spdlog/details/format.cc
+7
-13
No files found.
include/spdlog/details/format.cc
View file @
3e516699
...
...
@@ -28,11 +28,6 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Disable useless MSVC warnings.
#undef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#undef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <string.h>
...
...
@@ -49,7 +44,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# include <cstring>
# endif
# include <windows.h>
# undef ERROR
#endif
using
spdlog
::
details
::
fmt
::
LongLong
;
...
...
@@ -176,14 +170,14 @@ FMT_FUNC void format_error_code(spdlog::details::fmt::Writer &out, int error_cod
// bad_alloc.
out
.
clear
();
static
const
char
SEP
[]
=
": "
;
static
const
char
ERROR
[]
=
"error "
;
static
const
char
FMT_
ERROR
[]
=
"error "
;
spdlog
::
details
::
fmt
::
internal
::
IntTraits
<
int
>::
MainType
ec_value
=
error_code
;
// Subtract 2 to account for terminating null characters in SEP and ERROR.
// Subtract 2 to account for terminating null characters in SEP and
FMT_
ERROR.
std
::
size_t
error_code_size
=
sizeof
(
SEP
)
+
sizeof
(
ERROR
)
+
spdlog
::
details
::
fmt
::
internal
::
count_digits
(
ec_value
)
-
2
;
sizeof
(
SEP
)
+
sizeof
(
FMT_
ERROR
)
+
spdlog
::
details
::
fmt
::
internal
::
count_digits
(
ec_value
)
-
2
;
if
(
message
.
size
()
<=
spdlog
::
details
::
fmt
::
internal
::
INLINE_BUFFER_SIZE
-
error_code_size
)
out
<<
message
<<
SEP
;
out
<<
ERROR
<<
error_code
;
out
<<
FMT_
ERROR
<<
error_code
;
assert
(
out
.
size
()
<=
spdlog
::
details
::
fmt
::
internal
::
INLINE_BUFFER_SIZE
);
}
...
...
@@ -451,14 +445,14 @@ FMT_FUNC void spdlog::details::fmt::internal::report_unknown_type(char code, con
FMT_FUNC
spdlog
::
details
::
fmt
::
internal
::
UTF8ToUTF16
::
UTF8ToUTF16
(
spdlog
::
details
::
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"
;
static
const
char
FMT_
ERROR
[]
=
"cannot convert string from UTF-8 to UTF-16"
;
if
(
length
==
0
)
FMT_THROW
(
WindowsError
(
GetLastError
(),
ERROR
));
FMT_THROW
(
WindowsError
(
GetLastError
(),
FMT_
ERROR
));
buffer_
.
resize
(
length
);
length
=
MultiByteToWideChar
(
CP_UTF8
,
MB_ERR_INVALID_CHARS
,
s
.
c_str
(),
-
1
,
&
buffer_
[
0
],
length
);
if
(
length
==
0
)
FMT_THROW
(
WindowsError
(
GetLastError
(),
ERROR
));
FMT_THROW
(
WindowsError
(
GetLastError
(),
FMT_
ERROR
));
}
FMT_FUNC
spdlog
::
details
::
fmt
::
internal
::
UTF16ToUTF8
::
UTF16ToUTF8
(
spdlog
::
details
::
fmt
::
WStringRef
s
)
{
...
...
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