diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2013-07-31 19:25:50 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2013-07-31 19:25:50 +0200 |
commit | 72bbb5f42fe8e47d6314eb92a0ada6554644305c (patch) | |
tree | 1c3e5141d8f78260dff3078a3883cf34d69633cd /src/common.h | |
parent | b5d8e8e26c0116e4b6e556a0f6da8777bc55c590 (diff) | |
parent | a9ea3168615056360cdb21d6f1576d66be2a43fe (diff) | |
download | mtdev-git-72bbb5f42fe8e47d6314eb92a0ada6554644305c.tar.gz |
Merge more build fixes from Peter Hutterer, along with a more explicit
declaration of the backwards compatibility constraints on the API.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common.h b/src/common.h index 2ec8eb8..80a3d6e 100644 --- a/src/common.h +++ b/src/common.h @@ -87,6 +87,14 @@ static inline int bitcount(unsigned v) /* robust system ioctl calls */ #define SYSCALL(call) while (((call) == -1) && (errno == EINTR)) +/* To be compatible to the original, non-opaque mtdev API, we can only use 11 + * axes in the basic struct. Everything else is hidden in the state, see the + * use of dev->abs[idx] vs dev->state->ext_abs[idx] + * + * See MT_ABS_SIZE in include/mtdev.h + */ +#define LEGACY_API_NUM_MT_AXES 11 + /** * struct mtdev - represents an input MT device * @has_mtdata: true if the device has MT capabilities @@ -105,9 +113,9 @@ static inline int bitcount(unsigned v) struct mtdev { int has_mtdata; int has_slot; - int has_abs[11]; + int has_abs[LEGACY_API_NUM_MT_AXES]; struct input_absinfo slot; - struct input_absinfo abs[11]; + struct input_absinfo abs[LEGACY_API_NUM_MT_AXES]; struct mtdev_state *state; }; |