From 8ed3d52ee73360fe8ac9f2ea4f08fc719ddc906f Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Mon, 12 Oct 2009 16:17:19 +0000 Subject: Introduce rtems_error_code_t. Minor portability code-massaging. --- cpukit/libcsupport/include/rtems/error.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cpukit') 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 + #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, ...); /* -- cgit v1.2.3