Backends use a mixture of SANE_CURRENT_{MAJOR | MINOR} and V_{MAJOR |
MINOR} with all kind of permutations. I was confused by this and one
comment in pieusb.c tells me I was not alone. Some items in old
changelogs suggest to use the SANE_CURRENT_ macros in backends, so let's
switch to do that with the exception of net.c and dll.c. Done with:
$ find backend -name '*.[ch]' | xargs sed -i '/nearly every/ ! { s/\<V_M/SANE_CURRENT_M/g }'
$ git checkout backend/net.c backend/dll.c
And manually removing the comment from pieusb.c. Everything still builds
fine.
These 2 backends are basically copy&paste of each other and so
have duplicate symbol names.
When using prelink backend option, the duplicates will conflict
and cause compile failure. Probably even in shared libraries
this can be an issue in some cases.
Solved by converting functions to static when possible and
adding a kvs40xx_/kvs20xx_ prefix in remaining cases.