Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
6c825064
Commit
6c825064
authored
Sep 13, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/Error: add more "noexcept"
parent
13d02968
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
Error.hxx
src/system/Error.hxx
+11
-10
No files found.
src/system/Error.hxx
View file @
6c825064
...
...
@@ -40,7 +40,8 @@
template
<
typename
...
Args
>
static
inline
std
::
system_error
FormatSystemError
(
std
::
error_code
code
,
const
char
*
fmt
,
Args
&&
...
args
)
FormatSystemError
(
std
::
error_code
code
,
const
char
*
fmt
,
Args
&&
...
args
)
noexcept
{
char
buffer
[
1024
];
snprintf
(
buffer
,
sizeof
(
buffer
),
fmt
,
std
::
forward
<
Args
>
(
args
)...);
...
...
@@ -52,21 +53,21 @@ FormatSystemError(std::error_code code, const char *fmt, Args&&... args)
#include <windows.h>
static
inline
std
::
system_error
MakeLastError
(
DWORD
code
,
const
char
*
msg
)
MakeLastError
(
DWORD
code
,
const
char
*
msg
)
noexcept
{
return
std
::
system_error
(
std
::
error_code
(
code
,
std
::
system_category
()),
msg
);
}
static
inline
std
::
system_error
MakeLastError
(
const
char
*
msg
)
MakeLastError
(
const
char
*
msg
)
noexcept
{
return
MakeLastError
(
GetLastError
(),
msg
);
}
template
<
typename
...
Args
>
static
inline
std
::
system_error
FormatLastError
(
DWORD
code
,
const
char
*
fmt
,
Args
&&
...
args
)
FormatLastError
(
DWORD
code
,
const
char
*
fmt
,
Args
&&
...
args
)
noexcept
{
char
buffer
[
512
];
const
auto
end
=
buffer
+
sizeof
(
buffer
);
...
...
@@ -84,7 +85,7 @@ FormatLastError(DWORD code, const char *fmt, Args&&... args)
template
<
typename
...
Args
>
static
inline
std
::
system_error
FormatLastError
(
const
char
*
fmt
,
Args
&&
...
args
)
FormatLastError
(
const
char
*
fmt
,
Args
&&
...
args
)
noexcept
{
return
FormatLastError
(
GetLastError
(),
fmt
,
std
::
forward
<
Args
>
(
args
)...);
...
...
@@ -104,7 +105,7 @@ FormatLastError(const char *fmt, Args&&... args)
* @see https://stackoverflow.com/questions/28746372/system-error-categories-and-standard-system-error-codes
*/
static
inline
const
std
::
error_category
&
ErrnoCategory
()
ErrnoCategory
()
noexcept
{
#ifdef WIN32
/* on Windows, the generic_category() is used for errno
...
...
@@ -118,21 +119,21 @@ ErrnoCategory()
}
static
inline
std
::
system_error
MakeErrno
(
int
code
,
const
char
*
msg
)
MakeErrno
(
int
code
,
const
char
*
msg
)
noexcept
{
return
std
::
system_error
(
std
::
error_code
(
code
,
ErrnoCategory
()),
msg
);
}
static
inline
std
::
system_error
MakeErrno
(
const
char
*
msg
)
MakeErrno
(
const
char
*
msg
)
noexcept
{
return
MakeErrno
(
errno
,
msg
);
}
template
<
typename
...
Args
>
static
inline
std
::
system_error
FormatErrno
(
int
code
,
const
char
*
fmt
,
Args
&&
...
args
)
FormatErrno
(
int
code
,
const
char
*
fmt
,
Args
&&
...
args
)
noexcept
{
char
buffer
[
512
];
snprintf
(
buffer
,
sizeof
(
buffer
),
...
...
@@ -142,7 +143,7 @@ FormatErrno(int code, const char *fmt, Args&&... args)
template
<
typename
...
Args
>
static
inline
std
::
system_error
FormatErrno
(
const
char
*
fmt
,
Args
&&
...
args
)
FormatErrno
(
const
char
*
fmt
,
Args
&&
...
args
)
noexcept
{
return
FormatErrno
(
errno
,
fmt
,
std
::
forward
<
Args
>
(
args
)...);
}
...
...
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