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
3e8d2c57
Unverified
Commit
3e8d2c57
authored
Jul 07, 2020
by
escherstair
Committed by
GitHub
Jul 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CE6 support (#1749)
parent
8ad1c12f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
fmt/format.cc
fmt/format.cc
+18
-2
fmt/format.h
fmt/format.h
+2
-2
No files found.
fmt/format.cc
View file @
3e8d2c57
...
@@ -30,7 +30,9 @@
...
@@ -30,7 +30,9 @@
#include <string.h>
#include <string.h>
#include <cctype>
#include <cctype>
#include <cerrno>
#if !defined(UNDER_CE)
# include <cerrno>
#endif
#include <climits>
#include <climits>
#include <cmath>
#include <cmath>
#include <cstdarg>
#include <cstdarg>
...
@@ -98,7 +100,11 @@ namespace {
...
@@ -98,7 +100,11 @@ namespace {
inline
int
fmt_snprintf
(
char
*
buffer
,
size_t
size
,
const
char
*
format
,
...)
{
inline
int
fmt_snprintf
(
char
*
buffer
,
size_t
size
,
const
char
*
format
,
...)
{
va_list
args
;
va_list
args
;
va_start
(
args
,
format
);
va_start
(
args
,
format
);
# if !defined(UNDER_CE)
int
result
=
vsnprintf_s
(
buffer
,
size
,
_TRUNCATE
,
format
,
args
);
int
result
=
vsnprintf_s
(
buffer
,
size
,
_TRUNCATE
,
format
,
args
);
# else
int
result
=
_vsnprintf_s
(
buffer
,
size
,
_TRUNCATE
,
format
,
args
);
# endif
va_end
(
args
);
va_end
(
args
);
return
result
;
return
result
;
}
}
...
@@ -108,7 +114,11 @@ inline int fmt_snprintf(char *buffer, size_t size, const char *format, ...) {
...
@@ -108,7 +114,11 @@ inline int fmt_snprintf(char *buffer, size_t size, const char *format, ...) {
#if defined(_WIN32) && defined(__MINGW32__) && !defined(__NO_ISOCEXT)
#if defined(_WIN32) && defined(__MINGW32__) && !defined(__NO_ISOCEXT)
# define FMT_SWPRINTF snwprintf
# define FMT_SWPRINTF snwprintf
#else
#else
# if defined(UNDER_CE)
# define FMT_SWPRINTF swprintf_s
# else
# define FMT_SWPRINTF swprintf
# define FMT_SWPRINTF swprintf
#endif
#endif // defined(_WIN32) && defined(__MINGW32__) && !defined(__NO_ISOCEXT)
#endif // defined(_WIN32) && defined(__MINGW32__) && !defined(__NO_ISOCEXT)
const
char
RESET_COLOR
[]
=
"
\x1b
[0m"
;
const
char
RESET_COLOR
[]
=
"
\x1b
[0m"
;
...
@@ -137,11 +147,13 @@ int safe_strerror(
...
@@ -137,11 +147,13 @@ int safe_strerror(
// A noop assignment operator to avoid bogus warnings.
// A noop assignment operator to avoid bogus warnings.
void
operator
=
(
const
StrError
&
)
{}
void
operator
=
(
const
StrError
&
)
{}
#if !defined(UNDER_CE)
// Handle the result of XSI-compliant version of strerror_r.
// Handle the result of XSI-compliant version of strerror_r.
int
handle
(
int
result
)
{
int
handle
(
int
result
)
{
// glibc versions before 2.13 return result in errno.
// glibc versions before 2.13 return result in errno.
return
result
==
-
1
?
errno
:
result
;
return
result
==
-
1
?
errno
:
result
;
}
}
#endif
// Handle the result of GNU-specific version of strerror_r.
// Handle the result of GNU-specific version of strerror_r.
int
handle
(
char
*
message
)
{
int
handle
(
char
*
message
)
{
...
@@ -171,9 +183,13 @@ int safe_strerror(
...
@@ -171,9 +183,13 @@ int safe_strerror(
// Fallback to strerror if strerror_r and strerror_s are not available.
// Fallback to strerror if strerror_r and strerror_s are not available.
int
fallback
(
internal
::
Null
<>
)
{
int
fallback
(
internal
::
Null
<>
)
{
#if !defined(UNDER_CE)
errno
=
0
;
errno
=
0
;
buffer_
=
strerror
(
error_code_
);
buffer_
=
strerror
(
error_code_
);
return
errno
;
return
errno
;
#else
return
0
;
#endif
}
}
#ifdef __clang__
#ifdef __clang__
...
...
fmt/format.h
View file @
3e8d2c57
...
@@ -370,7 +370,7 @@ typedef __int64 intmax_t;
...
@@ -370,7 +370,7 @@ typedef __int64 intmax_t;
// otherwise support __builtin_clz and __builtin_clzll, so
// otherwise support __builtin_clz and __builtin_clzll, so
// only define FMT_BUILTIN_CLZ using the MSVC intrinsics
// only define FMT_BUILTIN_CLZ using the MSVC intrinsics
// if the clz and clzll builtins are not available.
// if the clz and clzll builtins are not available.
#if FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) && !defined(_MANAGED)
#if FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) && !defined(_MANAGED)
&& !defined(UNDER_CE)
# include <intrin.h> // _BitScanReverse, _BitScanReverse64
# include <intrin.h> // _BitScanReverse, _BitScanReverse64
namespace
fmt
{
namespace
fmt
{
...
@@ -3149,7 +3149,7 @@ void BasicWriter<Char>::write_int(T value, Spec spec) {
...
@@ -3149,7 +3149,7 @@ void BasicWriter<Char>::write_int(T value, Spec spec) {
case
'n'
:
{
case
'n'
:
{
unsigned
num_digits
=
internal
::
count_digits
(
abs_value
);
unsigned
num_digits
=
internal
::
count_digits
(
abs_value
);
fmt
::
StringRef
sep
=
""
;
fmt
::
StringRef
sep
=
""
;
#if
ndef __ANDROID__
#if
!defined(__ANDROID__) && !defined(UNDER_CE)
sep
=
internal
::
thousands_sep
(
std
::
localeconv
());
sep
=
internal
::
thousands_sep
(
std
::
localeconv
());
#endif
#endif
unsigned
size
=
static_cast
<
unsigned
>
(
unsigned
size
=
static_cast
<
unsigned
>
(
...
...
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