Kaydet (Commit) 9a5a5d1c authored tarafından Vladimir Marangozov's avatar Vladimir Marangozov

Checks whether right shift extends the sign bit.

Patch by Thomas Wouters <thomas@xs4all.net> with small changes of mine
(in main(), use return instead of exit).

Closes patch #100832
(but I can't assign it to myself, nor close it -- sorry)
üst bd9848d0
...@@ -1136,6 +1136,19 @@ AC_MSG_RESULT($usable_wchar_t) ...@@ -1136,6 +1136,19 @@ AC_MSG_RESULT($usable_wchar_t)
# check for endianness # check for endianness
AC_C_BIGENDIAN AC_C_BIGENDIAN
# Check whether right shifting a negative integer extends the sign bit
# or fills with zeros (like the Cray J90, according to Tim Peters).
AC_MSG_CHECKING(whether right shift extends the sign bit)
AC_TRY_RUN([
int main()
{
return ((-1)>>3 == -1) ? 1 : 0;
}
],
[AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
# THIS MUST BE LAST, IT CAN BREAK OTHER TESTS! # THIS MUST BE LAST, IT CAN BREAK OTHER TESTS!
# Add sys/socket.h to confdefs.h # Add sys/socket.h to confdefs.h
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment