diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-10-12 16:17:19 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-10-12 16:17:19 +0000 |
commit | 8ed3d52ee73360fe8ac9f2ea4f08fc719ddc906f (patch) | |
tree | b915b914385e764e9616517b8d0b5596ead6ea50 /cpukit/libcsupport/include/rtems/error.h | |
parent | 2009-10-12 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-8ed3d52ee73360fe8ac9f2ea4f08fc719ddc906f.tar.bz2 |
Introduce rtems_error_code_t.
Minor portability code-massaging.
Diffstat (limited to 'cpukit/libcsupport/include/rtems/error.h')
-rw-r--r-- | cpukit/libcsupport/include/rtems/error.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cpukit/libcsupport/include/rtems/error.h b/cpukit/libcsupport/include/rtems/error.h index 5d9ba15e50..e79cd9d1d2 100644 --- a/cpukit/libcsupport/include/rtems/error.h +++ b/cpukit/libcsupport/include/rtems/error.h @@ -11,15 +11,19 @@ #ifndef _RTEMS_RTEMS_ERROR_H #define _RTEMS_RTEMS_ERROR_H +#include <rtems/score/interr.h> + #ifdef __cplusplus extern "C" { #endif +typedef Internal_errors_t rtems_error_code_t; + /* * rtems_error() and rtems_panic() support */ -#define RTEMS_ERROR_ERRNO (1<<((sizeof(int) * 8) - 2)) /* hi bit; use 'errno' */ +#define RTEMS_ERROR_ERRNO (1<<((sizeof(rtems_error_code_t) * CHAR_BIT) - 2)) /* hi bit; use 'errno' */ #define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO / 2) /* err fatal; no return */ #define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO / 4) /* err is fatal; panic */ @@ -27,7 +31,7 @@ extern "C" { RTEMS_ERROR_PANIC) /* all */ const char *rtems_status_text(rtems_status_code); -int rtems_error(int error_code, const char *printf_format, ...); +int rtems_error(rtems_error_code_t error_code, const char *printf_format, ...); #ifdef __GNUC__ void rtems_panic(const char *printf_format, ...); /* |