From ce0adfac23ad42e907118cb1dd1d91ad16a9ef33 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 18 Aug 2012 16:28:18 +0200 Subject: [PATCH] Move adu_strerror() to adu.c. This function is a bit too large to be inlined, and it depends on osl. --- adu.c | 19 +++++++++++++++++++ error.h | 20 +------------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/adu.c b/adu.c index 0cd1644..7d133d6 100644 --- a/adu.c +++ b/adu.c @@ -125,6 +125,25 @@ __printf_2_3 void __log(int ll, const char* fmt,...) va_end(argp); } +/** + * adu's version of strerror(3). + * + * \param num The error number. + * + * \return The error text of \a num. + */ +const char *adu_strerror(int num) +{ + assert(num > 0); + if (num == E_OSL) { + assert(osl_errno > 0); + return osl_strerror((osl_errno)); + } + if (IS_SYSTEM_ERROR(num)) + return strerror((num) & ((1 << SYSTEM_ERROR_BIT) - 1)); + return adu_errlist[num]; +} + static void close_dir_table(void) { int ret; diff --git a/error.h b/error.h index 9849916..b37ba78 100644 --- a/error.h +++ b/error.h @@ -75,25 +75,7 @@ extern int osl_errno; /** Contains the description of all adu error codes. */ extern char *adu_errlist[]; - -/** - * adu's version of strerror(3). - * - * \param num The error number. - * - * \return The error text of \a num. - */ -_static_inline_ const char *adu_strerror(int num) -{ - assert(num > 0); - if (num == E_OSL) { - assert(osl_errno > 0); - return osl_strerror((osl_errno)); - } - if (IS_SYSTEM_ERROR(num)) - return strerror((num) & ((1 << SYSTEM_ERROR_BIT) - 1)); - return adu_errlist[num]; -} +extern const char *adu_strerror(int num); /** * Wrapper for osl library calls. -- 2.39.5