aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-02-27 16:37:26 -0800
committerElliott Hughes <enh@google.com>2013-02-27 16:37:47 -0800
commit97b655635ba6182013989f2d0b956fe8ff0b921d (patch)
treef054efd6b72143f2e8ba57afa050bcaa6dd1f2c2
parentdcaa472c509be6932211ce242ac7635286c01fac (diff)
downloadlibnativehelper-97b655635ba6182013989f2d0b956fe8ff0b921d.tar.gz
Use <stdint.h> in jni.h for better x86_64 portability.
Otherwise templates won't match jlong to long or int64_t. Change-Id: I805133d86f75691c6920bebf3d79f1ce47f0861c
-rw-r--r--include/nativehelper/jni.h37
1 files changed, 12 insertions, 25 deletions
diff --git a/include/nativehelper/jni.h b/include/nativehelper/jni.h
index e4d74cf..1c2fb0c 100644
--- a/include/nativehelper/jni.h
+++ b/include/nativehelper/jni.h
@@ -25,33 +25,20 @@
#define JNI_H_
#include <stdarg.h>
-
-/*
- * Primitive types that match up with Java equivalents.
- */
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h> /* C99 */
-typedef uint8_t jboolean; /* unsigned 8 bits */
-typedef int8_t jbyte; /* signed 8 bits */
-typedef uint16_t jchar; /* unsigned 16 bits */
-typedef int16_t jshort; /* signed 16 bits */
-typedef int32_t jint; /* signed 32 bits */
-typedef int64_t jlong; /* signed 64 bits */
-typedef float jfloat; /* 32-bit IEEE 754 */
-typedef double jdouble; /* 64-bit IEEE 754 */
-#else
-typedef unsigned char jboolean; /* unsigned 8 bits */
-typedef signed char jbyte; /* signed 8 bits */
-typedef unsigned short jchar; /* unsigned 16 bits */
-typedef short jshort; /* signed 16 bits */
-typedef int jint; /* signed 32 bits */
-typedef long long jlong; /* signed 64 bits */
-typedef float jfloat; /* 32-bit IEEE 754 */
-typedef double jdouble; /* 64-bit IEEE 754 */
-#endif
+#include <stdint.h>
+
+/* Primitive types that match up with Java equivalents. */
+typedef uint8_t jboolean; /* unsigned 8 bits */
+typedef int8_t jbyte; /* signed 8 bits */
+typedef uint16_t jchar; /* unsigned 16 bits */
+typedef int16_t jshort; /* signed 16 bits */
+typedef int32_t jint; /* signed 32 bits */
+typedef int64_t jlong; /* signed 64 bits */
+typedef float jfloat; /* 32-bit IEEE 754 */
+typedef double jdouble; /* 64-bit IEEE 754 */
/* "cardinal indices and sizes" */
-typedef jint jsize;
+typedef jint jsize;
#ifdef __cplusplus
/*