diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-10-08 11:13:21 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2014-10-08 11:13:21 +0300 |
commit | 32627939f5c57887b25100dd49aa91839876abed (patch) | |
tree | c39918143209386d1509c70d56fe8683878f2b30 /src/apk_defines.h | |
parent | 555363f056377508040d3a555d198c4b87aff3a3 (diff) | |
download | apk-tools-32627939f5c57887b25100dd49aa91839876abed.tar.gz apk-tools-32627939f5c57887b25100dd49aa91839876abed.tar.bz2 apk-tools-32627939f5c57887b25100dd49aa91839876abed.tar.xz apk-tools-32627939f5c57887b25100dd49aa91839876abed.zip |
io,url,db: support for if-modified-since
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r-- | src/apk_defines.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h index 95b70de..d27bad4 100644 --- a/src/apk_defines.h +++ b/src/apk_defines.h @@ -32,6 +32,12 @@ #define NULL 0L #endif +static inline void *ERR_PTR(long error) { return (void*) error; } +static inline void *ERR_CAST(const void *ptr) { return (void*) ptr; } +static inline int PTR_ERR(const void *ptr) { return (int)(long) ptr; } +static inline int IS_ERR(const void *ptr) { return (unsigned long)ptr >= (unsigned long)-4095; } +static inline int IS_ERR_OR_NULL(const void *ptr) { return IS_ERR(ptr) || !ptr; } + #if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96 #define __builtin_expect(x, expected_value) (x) #endif |