]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - error.h
Fix para_strerror() and use osl() wrapper for osl library calls.
[paraslash.git] / error.h
diff --git a/error.h b/error.h
index ba18c6dcf81382f4fb4bccaa090704857c6cc9fe..fb46ec548714c6e30ddcc01f2cd891ad1fd9f419 100644 (file)
--- a/error.h
+++ b/error.h
@@ -6,8 +6,6 @@
 
 /** \file error.h List of error messages for all subsystems. */
 
 
 /** \file error.h List of error messages for all subsystems. */
 
-#include <osl.h>
-
 /** \cond */
 
 /* List of all subsystems that use paraslash's error facility. */
 /** \cond */
 
 /* List of all subsystems that use paraslash's error facility. */
@@ -483,8 +481,10 @@ _static_inline_ int is_errno(int num, int _errno)
 _static_inline_ const char *para_strerror(int num)
 {
        assert(num > 0);
 _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));
        if (IS_OSL_ERROR(num))
                return osl_strerror(num & ((1 << OSL_ERROR_BIT) - 1));
+#endif
        if (IS_SYSTEM_ERROR(num))
                return strerror(num & ((1 << SYSTEM_ERROR_BIT) - 1));
        return para_errlist[ERRNUM_TO_SS(num)][ERRNUM_TO_INDEX(num)];
        if (IS_SYSTEM_ERROR(num))
                return strerror(num & ((1 << SYSTEM_ERROR_BIT) - 1));
        return para_errlist[ERRNUM_TO_SS(num)][ERRNUM_TO_INDEX(num)];
@@ -496,10 +496,10 @@ _static_inline_ const char *para_strerror(int num)
  * \param ret The return value of an osl library function.
  *
  * This should be used for all calls to osl functions that return an osl error
  * \param ret The return value of an osl library function.
  *
  * This should be used for all calls to osl functions that return an osl error
- * code. It changes the return value to \p -E_OSL appropriately so that it can
- * be used for printing the correct error message.
+ * code. It changes the return value appropriately so that it can be used for
+ * printing the correct error message vi para_strerror().
  *
  *
- * \return \a ret if \a ret >= 0, \p -E_OSL otherwise.
+ * \return \a ret if \a ret >= 0, a paraslash error code otherwise.
  */
 _static_inline_ int osl(int ret)
 {
  */
 _static_inline_ int osl(int ret)
 {
@@ -508,7 +508,6 @@ _static_inline_ int osl(int ret)
        return OSL_ERRNO_TO_PARA_ERROR(-ret);
 }
 
        return OSL_ERRNO_TO_PARA_ERROR(-ret);
 }
 
-
 /**
  * Define the error list for one subsystem.
  #
 /**
  * Define the error list for one subsystem.
  #