Avoid code duplication between null_chk and nil_chk.
Change on 2017/09/25 by kstanger
#include "java/nio/Buffer.h"
#include "java/nio/DirectByteBuffer.h"
+#define null_chk(p) nil_chk(p)
+
static IOSClass *IOSClass_forName(const char *name) {
NSString *nameString = [NSString stringWithUTF8String:name];
nameString = [nameString stringByReplacingOccurrencesOfString:@"/" withString:@"."];
@@ -123,15 +125,6 @@ NSString *JNIFormatMethodSignature(JNIMethodSignature sig) {
return result;
}
-__attribute__ ((unused)) static inline id null_chk(void *p) {
-#if !defined(J2OBJC_DISABLE_NIL_CHECKS)
- if (__builtin_expect(!p, 0)) {
- JreThrowNullPointerException();
- }
-#endif
- return p;
-}
-
static void *GetPrimitiveArrayCritical(JNIEnv *, jarray, jboolean *);
static jclass FindClass(JNIEnv *env, const char *name) {
