X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=error.h;h=49a57a5a15bcd6c070328161310be83cd0a7379a;hb=9bf6dc2e;hp=379d37326782f308ce6b7e576c25383ea1b7b8c7;hpb=1fd34762208566dfe2d2e07772e4af088f833a2b;p=paraslash.git diff --git a/error.h b/error.h index 379d3732..49a57a5a 100644 --- a/error.h +++ b/error.h @@ -578,6 +578,8 @@ extern const char **para_errlist[]; /** Set the osl error bit for the given number. */ #define OSL_ERRNO_TO_PARA_ERROR(num) ((num) | (1 << OSL_ERROR_BIT)) + +static const char *weak_osl_strerror(int) __attribute__ ((weakref("osl_strerror"))); /** * Paraslash's version of strerror(3). * @@ -588,10 +590,10 @@ extern const char **para_errlist[]; _static_inline_ const char *para_strerror(int num) { assert(num > 0); -#ifdef _OSL_H - if (IS_OSL_ERROR(num)) - return osl_strerror(num & ~(1U << OSL_ERROR_BIT)); -#endif + if (IS_OSL_ERROR(num)) { + assert(weak_osl_strerror); + return weak_osl_strerror(num & ~(1U << OSL_ERROR_BIT)); + } if (IS_SYSTEM_ERROR(num)) return strerror(num & ~(1U << SYSTEM_ERROR_BIT)); return para_errlist[ERRNUM_TO_SS(num)][ERRNUM_TO_INDEX(num)];