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
d1bc46ff
Commit
d1bc46ff
authored
Jul 30, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/Error: add SetLastError() overload with "DWORD code" parameter
parent
32e5848f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
Error.cxx
src/util/Error.cxx
+7
-2
Error.hxx
src/util/Error.hxx
+1
-0
No files found.
src/util/Error.cxx
View file @
d1bc46ff
...
@@ -133,11 +133,16 @@ Error::FormatErrno(const char *fmt, ...)
...
@@ -133,11 +133,16 @@ Error::FormatErrno(const char *fmt, ...)
#ifdef WIN32
#ifdef WIN32
void
void
Error
::
SetLastError
(
const
char
*
prefix
)
Error
::
SetLastError
(
DWORD
_code
,
const
char
*
prefix
)
{
{
DWORD
_code
=
GetLastError
();
const
char
*
msg
=
g_win32_error_message
(
_code
);
const
char
*
msg
=
g_win32_error_message
(
_code
);
Format
(
win32_domain
,
int
(
_code
),
"%s: %s"
,
prefix
,
msg
);
Format
(
win32_domain
,
int
(
_code
),
"%s: %s"
,
prefix
,
msg
);
}
}
void
Error
::
SetLastError
(
const
char
*
prefix
)
{
SetLastError
(
GetLastError
(),
prefix
);
}
#endif
#endif
src/util/Error.hxx
View file @
d1bc46ff
...
@@ -166,6 +166,7 @@ public:
...
@@ -166,6 +166,7 @@ public:
void
FormatErrno
(
int
e
,
const
char
*
prefix
,
...);
void
FormatErrno
(
int
e
,
const
char
*
prefix
,
...);
#ifdef WIN32
#ifdef WIN32
void
SetLastError
(
DWORD
_code
,
const
char
*
prefix
);
void
SetLastError
(
const
char
*
prefix
);
void
SetLastError
(
const
char
*
prefix
);
#endif
#endif
};
};
...
...
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