Something is wrong with JNI's jlong in JDK7 (original) (raw)
Scott Palmer swpalmer at gmail.com
Tue Nov 13 08:21:32 PST 2012
- Previous message: issues after porting a mac app from Java 6 to 7u9
- Next message: Something is wrong with JNI's jlong in JDK7
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I just noticed that the criteria for defining jlong has changed from that given in Apple's JDK 6 vs. Oracle's JDK 7. This caused some code of mine to break because it seems to be wrong under some circumstances.
JDK 7u10 has this. Note that sometimes a jlong is a C "long" and sometimes it is a C "long long":
#ifndef JAVASOFT_JNI_MD_H #define JAVASOFT_JNI_MD_H
#define JNIEXPORT #define JNIIMPORT #define JNICALL
typedef int jint; #ifdef _LP64 /* 64-bit Solaris */ typedef long jlong; #else typedef long long jlong; #endif
typedef signed char jbyte;
#endif /* !JAVASOFT_JNI_MD_H */
Whereas Apple's JDK 6 always uses "long long":
#ifndef JAVASOFT_JNI_MD_H #define JAVASOFT_JNI_MD_H
#define JNIEXPORT attribute((visibility("default"))) #define JNIIMPORT #define JNICALL
#if defined(LP64) && LP64 /* for -Wundef */ typedef int jint; #else typedef long jint; #endif typedef long long jlong; typedef signed char jbyte;
#endif /* !JAVASOFT_JNI_MD_H */
- Previous message: issues after porting a mac app from Java 6 to 7u9
- Next message: Something is wrong with JNI's jlong in JDK7
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]