aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-11-20 21:19:26 +0900
committerJean Chalard <jchalard@google.com>2012-11-20 21:25:46 +0900
commit592f2b315fd1d5eaab96c909e8e95b15200ab416 (patch)
tree461b2c16228be62fa365faf29544f38c455a3a29
parent66cee1f92de0413756b8f306275d3508cd2b040f (diff)
downloadlatinime-592f2b315fd1d5eaab96c909e8e95b15200ab416.tar.gz
latinime-592f2b315fd1d5eaab96c909e8e95b15200ab416.tar.xz
latinime-592f2b315fd1d5eaab96c909e8e95b15200ab416.zip
Add a constant for S_INT_MIN
This is necessary for I807ae4bd Bug: 7491364 Change-Id: I46ee92a76eb65e80b64538d0300b718eac6a3ddb
-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