rename lib/errors.* to lib/lib_errors.* due to conflict with ps/errors.*
also add sys_error_description_r backend for unix This was SVN commit r3160.
This commit is contained in:
parent
0491a7980d
commit
efbe061214
@ -61,7 +61,7 @@ scope
|
|||||||
|
|
||||||
// define error codes
|
// define error codes
|
||||||
#define ERR(err, id, str) const int id = err;
|
#define ERR(err, id, str) const int id = err;
|
||||||
#include "lib/errors.h"
|
#include "lib/lib_errors.h"
|
||||||
|
|
||||||
#include "sysdep/sysdep.h"
|
#include "sysdep/sysdep.h"
|
||||||
#include "sysdep/cpu.h" // CAS
|
#include "sysdep/cpu.h" // CAS
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
|
// note: this is called lib_errors.cpp because we have another
|
||||||
|
// errors.cpp; the MS linker isn't smart enough to deal with
|
||||||
|
// object files of the same name but in different paths.
|
||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
|
|
||||||
#include "errors.h"
|
#include "lib_errors.h"
|
||||||
#include "sysdep/sysdep.h"
|
#include "sysdep/sysdep.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -16,7 +20,7 @@ static const char* lib_error_description(int err)
|
|||||||
switch(err)
|
switch(err)
|
||||||
{
|
{
|
||||||
#define ERR(err, id, str) case id: return str;
|
#define ERR(err, id, str) case id: return str;
|
||||||
#include "errors.h"
|
#include "lib_errors.h"
|
||||||
default: return "Unknown lib error";
|
default: return "Unknown lib error";
|
||||||
}
|
}
|
||||||
UNREACHABLE;
|
UNREACHABLE;
|
@ -1,3 +1,7 @@
|
|||||||
|
// note: this is called lib_errors.h because we have another
|
||||||
|
// errors.cpp; the MS linker isn't smart enough to deal with
|
||||||
|
// object files of the same name but in different paths.
|
||||||
|
|
||||||
// X macros: error code, symbolic name in code, user-visible string.
|
// X macros: error code, symbolic name in code, user-visible string.
|
||||||
// error code is usually negative; positive denotes warnings.
|
// error code is usually negative; positive denotes warnings.
|
||||||
// its absolute value must be within [ERR_MIN, ERR_MAX).
|
// its absolute value must be within [ERR_MIN, ERR_MAX).
|
@ -121,3 +121,11 @@ int sys_cursor_free(void* cursor)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int sys_error_description_r(int err, char* buf, size_t max_chars)
|
||||||
|
{
|
||||||
|
// don't need to do anything: lib/errors.cpp already queries
|
||||||
|
// libc's strerror(). if we ever end up needing translation of
|
||||||
|
// e.g. Qt or X errors, that'd go here.
|
||||||
|
return -1;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user