aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-11-20 19:38:46 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-11-20 19:38:46 -0800
commit37fbcb0ddf2bf61f0e432534b671596b1b6f897e (patch)
tree5cc23a6288218ef8abb5a97ceda79c7a91c5e7fe
parente44ce053e724e74effc52cb2343082ce1c595073 (diff)
parent6d471258b2eb15cb10b5eec04854a76881ebac5d (diff)
downloadlatinime-37fbcb0ddf2bf61f0e432534b671596b1b6f897e.tar.gz
latinime-37fbcb0ddf2bf61f0e432534b671596b1b6f897e.tar.xz
latinime-37fbcb0ddf2bf61f0e432534b671596b1b6f897e.zip
am 6d471258: am c9349db1: Merge "Add a constant for S_INT_MIN" into jb-mr1.1-dev
* commit '6d471258b2eb15cb10b5eec04854a76881ebac5d': Add a constant for S_INT_MIN
-rw-r--r--native/jni/src/defines.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h
index ea0f0ef70..e06ee42b0 100644
--- a/native/jni/src/defines.h
+++ b/native/jni/src/defines.h
@@ -250,6 +250,12 @@ static inline void prof_out(void) {
#ifndef S_INT_MAX
#define S_INT_MAX 2147483647 // ((1 << 31) - 1)
#endif
+#ifndef S_INT_MIN
+// The literal constant -2147483648 does not work in C prior C90, because
+// the compiler tries to fit the positive number into an int and then negate it.
+// GCC warns about this.
+#define S_INT_MIN (-2147483647 - 1) // -(1 << 31)
+#endif
// Define this to use mmap() for dictionary loading. Undefine to use malloc() instead of mmap().
// We measured and compared performance of both, and found mmap() is fairly good in terms of