Check signed right shift behaviour at compile time
commit3039eee3049c14f6dc803a9bf490b8ee9bb8ec04
authorOlly Betts <olly@survex.com>
Sat, 17 Dec 2016 07:42:27 +0000 (17 20:42 +1300)
committerOlly Betts <olly@survex.com>
Mon, 19 Dec 2016 00:42:19 +0000 (19 13:42 +1300)
tree754b98692fa43348b8cbe19b6ec90d8a6b30a910
parent74f31bb87b4b1a4dcc9ba00401e808612f65325a
Check signed right shift behaviour at compile time

We can use a test on a constant expression which should optimise away to
just the required version of the code, which means that on platforms
which perform sign-extension (pretty much everything current it seems)
we don't have to rely on the compiler optimising a portable idiom
correctly.

(cherry picked from commit f08e5fb4637a46a15d83f8584d5eed44ee3e072f)
xapian-core/include/xapian/unicode.h