From: Jens Axboe Date: Wed, 12 Feb 2014 15:22:01 +0000 (-0700) Subject: Make err.h a bit more Windows friendly X-Git-Tag: fio-2.1.6~50 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e0739a728590d0890615a47988f3e79128e47a05 Make err.h a bit more Windows friendly Using unsigned long to hold pointers is a linuxism, clean it up. Signed-off-by: Jens Axboe --- diff --git a/err.h b/err.h index 5c024ee8..0765f1b6 100644 --- a/err.h +++ b/err.h @@ -11,26 +11,26 @@ */ #define MAX_ERRNO 4095 -#define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO) +#define IS_ERR_VALUE(x) ((x) >= (uintptr_t)-MAX_ERRNO) -static inline void *ERR_PTR(long error) +static inline void *ERR_PTR(uintptr_t error) { return (void *) error; } -static inline long PTR_ERR(const void *ptr) +static inline uintptr_t PTR_ERR(const void *ptr) { - return (long) ptr; + return (uintptr_t) ptr; } -static inline long IS_ERR(const void *ptr) +static inline uintptr_t IS_ERR(const void *ptr) { - return IS_ERR_VALUE((unsigned long)ptr); + return IS_ERR_VALUE((uintptr_t)ptr); } -static inline long IS_ERR_OR_NULL(const void *ptr) +static inline uintptr_t IS_ERR_OR_NULL(const void *ptr) { - return !ptr || IS_ERR_VALUE((unsigned long)ptr); + return !ptr || IS_ERR_VALUE((uintptr_t)ptr); } static inline int PTR_ERR_OR_ZERO(const void *ptr)