diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-05-24 21:03:56 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-05-24 21:03:56 +0200 |
commit | 58912f68c2489bcee787599837447e0d64dfd61a (patch) | |
tree | dda50aadde35fe152da1a8d50769987ace0f1496 /backend/kvs40xx.h | |
parent | cfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (diff) |
New upstream version 1.0.27upstream/1.0.27
Diffstat (limited to 'backend/kvs40xx.h')
-rw-r--r-- | backend/kvs40xx.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backend/kvs40xx.h b/backend/kvs40xx.h index fa17163..7fdebe6 100644 --- a/backend/kvs40xx.h +++ b/backend/kvs40xx.h @@ -10,6 +10,9 @@ #include "../include/sane/config.h" #include <semaphore.h> +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif #undef BACKEND_NAME #define BACKEND_NAME kvs40xx @@ -225,6 +228,18 @@ swap_bytes32 (u32 x) (x & (u32) 0x0000ff00UL) << 8 | (x & (u32) 0x00ff0000UL) >> 8; } +static inline void +copy16 (u8 * p, u16 x) +{ + memcpy (p, (u8 *) &x, sizeof (x)); +} + +static inline void +copy32 (u8 * p, u32 x) +{ + memcpy (p, (u8 *) &x, sizeof (x)); +} + #if WORDS_BIGENDIAN static inline void set24 (u8 * p, u32 x) |