aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-11 16:23:42 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-11 16:24:29 -0400
commit44ad73457303ed0bf80f6c4c645a62e03b42149b (patch)
treea7aeb75625c0643b7c2434dc4c57beecd87e8826 /configure.in
parent7206d784dc3def970d5bd8618242f7b9c9c71e37 (diff)
parent59f9097d5c3dc010847c359888d31757d1c97904 (diff)
downloadtor-44ad73457303ed0bf80f6c4c645a62e03b42149b.tar
tor-44ad73457303ed0bf80f6c4c645a62e03b42149b.tar.gz
Merge remote-tracking branch 'public/3122_memcmp_squashed' into bug3122_memcmp_022
Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 2e449ec48..aa2233d4e 100644
--- a/configure.in
+++ b/configure.in
@@ -695,6 +695,24 @@ if test "$tor_cv_twos_complement" != no ; then
[Define to 1 iff we represent negative integers with two's complement])
fi
+# What does shifting a negative value do?
+AC_CACHE_CHECK([whether right-shift on negative values does sign-extension], tor_cv_sign_extend,
+[AC_RUN_IFELSE([AC_LANG_SOURCE(
+[[int main () { int okay = (-60 >> 8) == -1; return okay ? 0 : 1; }]])],
+ [tor_cv_sign_extend=yes],
+ [tor_cv_sign_extend=no],
+ [tor_cv_sign_extend=cross])])
+
+if test "$tor_cv_sign_extend" = cross ; then
+ # Cross-compiling; let's hope that the target isn't raving mad.
+ AC_MSG_NOTICE([Cross-compiling: we'll assume that right-shifting negative integers causes sign-extension])
+fi
+
+if test "$tor_cv_sign_extend" != no ; then
+ AC_DEFINE([RSHIFT_DOES_SIGN_EXTEND], 1,
+ [Define to 1 iff right-shifting a negative value performs sign-extension])
+fi
+
# Whether we should use the dmalloc memory allocation debugging library.
AC_MSG_CHECKING(whether to use dmalloc (debug memory allocation library))
AC_ARG_WITH(dmalloc,