Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Richard Gobeille
EDuke32
Commits
747a0a45
Commit
747a0a45
authored
Jun 26, 2022
by
Richard Gobeille
Browse files
loguru: add a handful of fixes from upstream
parent
0ce08032
Changes
2
Hide whitespace changes
Inline
Side-by-side
source/build/include/loguru.hpp
View file @
747a0a45
...
...
@@ -535,7 +535,7 @@ namespace loguru
// Writes date and time with millisecond precision, e.g. "20151017_161503.123"
LOGURU_EXPORT
void
write_date_time
(
char
*
buff
,
unsigned
buff_size
);
void
write_date_time
(
char
*
buff
,
unsigned
long
long
buff_size
);
// Helper: thread-safe version strerror
LOGURU_EXPORT
...
...
@@ -547,7 +547,7 @@ namespace loguru
where "app_name" is a sanitized version of argv[0].
*/
LOGURU_EXPORT
void
suggest_log_path
(
const
char
*
prefix
,
char
*
buff
,
unsigned
buff_size
);
void
suggest_log_path
(
const
char
*
prefix
,
char
*
buff
,
unsigned
long
long
buff_size
);
enum
FileMode
{
Truncate
,
Append
};
...
...
@@ -732,13 +732,22 @@ namespace loguru
template
<
class
T
>
inline
Text
format_value
(
const
T
&
)
{
return
textprintf
(
"N/A"
);
}
template
<
>
inline
Text
format_value
(
const
char
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
c
),
v
);
}
template
<
>
inline
Text
format_value
(
const
int
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
d
),
v
);
}
template
<
>
inline
Text
format_value
(
const
float
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
f
),
v
);
}
template
<
>
inline
Text
format_value
(
const
double
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
f
),
v
);
}
#if LOGURU_USE_FMTLIB
template
<
>
inline
Text
format_value
(
const
unsigned
int
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
d
),
v
);
}
template
<
>
inline
Text
format_value
(
const
long
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
d
),
v
);
}
template
<
>
inline
Text
format_value
(
const
unsigned
long
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
d
),
v
);
}
template
<
>
inline
Text
format_value
(
const
long
long
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
d
),
v
);
}
template
<
>
inline
Text
format_value
(
const
unsigned
long
long
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
d
),
v
);
}
#else
template
<
>
inline
Text
format_value
(
const
unsigned
int
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
u
),
v
);
}
template
<
>
inline
Text
format_value
(
const
long
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
lu
),
v
);
}
template
<
>
inline
Text
format_value
(
const
unsigned
long
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
ld
),
v
);
}
template
<
>
inline
Text
format_value
(
const
long
long
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
llu
),
v
);
}
template
<
>
inline
Text
format_value
(
const
unsigned
long
long
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
lld
),
v
);
}
template
<
>
inline
Text
format_value
(
const
float
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
f
),
v
);
}
template
<
>
inline
Text
format_value
(
const
double
&
v
)
{
return
textprintf
(
LOGURU_FMT
(
f
),
v
);
}
#endif
/* Thread names can be set for the benefit of readable logs.
If you do not set the thread name, a hex id will be shown instead.
...
...
source/build/src/loguru.cpp
View file @
747a0a45
...
...
@@ -508,10 +508,10 @@ namespace loguru
last_is_alpha
=
std
::
isalpha
(
cmd
[
arg_len
],
std
::
locale
(
""
));
}
catch
(...)
{
last_is_alpha
=
std
::
isalpha
(
cmd
[
arg_len
]);
last_is_alpha
=
std
::
isalpha
(
static_cast
<
int
>
(
cmd
[
arg_len
])
)
;
}
#else
last_is_alpha
=
std
::
isalpha
(
cmd
[
arg_len
]);
last_is_alpha
=
std
::
isalpha
(
static_cast
<
int
>
(
cmd
[
arg_len
])
)
;
#endif
if
(
strncmp
(
cmd
,
verbosity_flag
,
arg_len
)
==
0
&&
!
last_is_alpha
)
{
...
...
@@ -727,7 +727,7 @@ namespace loguru
set_name_to_verbosity_callback
(
nullptr
);
}
void
write_date_time
(
char
*
buff
,
size_t
buff_size
)
void
write_date_time
(
char
*
buff
,
unsigned
long
long
buff_size
)
{
// EDUKE32 MODIFICATION
tm
time_info
;
...
...
@@ -773,7 +773,7 @@ namespace loguru
#endif // _WIN32
}
void
suggest_log_path
(
const
char
*
prefix
,
char
*
buff
,
unsigned
buff_size
)
void
suggest_log_path
(
const
char
*
prefix
,
char
*
buff
,
unsigned
long
long
buff_size
)
{
if
(
prefix
[
0
]
==
'~'
)
{
snprintf
(
buff
,
buff_size
-
1
,
"%s%s"
,
home_dir
(),
prefix
+
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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