From: Andre Noll Date: Sat, 18 Aug 2012 14:28:18 +0000 (+0200) Subject: Move adu_strerror() to adu.c. X-Git-Tag: v1.0.0~13 X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=commitdiff_plain;h=ce0adfac23ad42e907118cb1dd1d91ad16a9ef33 Move adu_strerror() to adu.c. This function is a bit too large to be inlined, and it depends on osl. --- 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.