X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=error.h;h=40e097e33cd180fae9b1f3709dcd362a563ffd81;hp=27e9e264ba10206e9218ac25013f63f04bc821ec;hb=030a9d5c9fe28328d5db977bf2c8ddbf7302673d;hpb=4f18e922663731106fbc64dcc0583a7b017ac407 diff --git a/error.h b/error.h index 27e9e264..40e097e3 100644 --- a/error.h +++ b/error.h @@ -279,6 +279,7 @@ extern const char **para_errlist[]; PARA_ERROR(NO_AFHI, "audio format handler info required"), \ PARA_ERROR(AFT_SYNTAX, "audio file table syntax error"), \ PARA_ERROR(HASH_MISMATCH, "hash mismatch, consider re-add"), \ + PARA_ERROR(NO_MATCH, "no matches"), \ #define USER_LIST_ERRORS \ @@ -578,6 +579,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,12 +591,12 @@ 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 & ((1 << OSL_ERROR_BIT) - 1)); -#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 & ((1 << SYSTEM_ERROR_BIT) - 1)); + return strerror(num & ~(1U << SYSTEM_ERROR_BIT)); return para_errlist[ERRNUM_TO_SS(num)][ERRNUM_TO_INDEX(num)]; }