Bug 701374 - Add macros for wrappers with return value (r=dougt)

--HG--
extra : rebase_source : 9fbc2c264d08fea75542471370db6e228dba6226
This commit is contained in:
Lucas Rocha 2011-11-23 09:46:26 -08:00
Родитель 436e9b153b
Коммит cdd9cf7ffa
1 изменённых файлов: 36 добавлений и 0 удалений

Просмотреть файл

@ -219,6 +219,15 @@ Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc) \
f_ ## name(jenv, jc); \
}
#define SHELL_WRAPPER0_WITH_RETURN(name, return_type) \
typedef return_type (*name ## _t)(JNIEnv *, jclass); \
static name ## _t f_ ## name; \
extern "C" NS_EXPORT return_type JNICALL \
Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc) \
{ \
return f_ ## name(jenv, jc); \
}
#define SHELL_WRAPPER1(name,type1) \
typedef void (*name ## _t)(JNIEnv *, jclass, type1 one); \
static name ## _t f_ ## name; \
@ -228,6 +237,15 @@ Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc, type1 one
f_ ## name(jenv, jc, one); \
}
#define SHELL_WRAPPER1_WITH_RETURN(name, return_type, type1) \
typedef return_type (*name ## _t)(JNIEnv *, jclass, type1 one); \
static name ## _t f_ ## name; \
extern "C" NS_EXPORT return_type JNICALL \
Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc, type1 one) \
{ \
return f_ ## name(jenv, jc, one); \
}
#define SHELL_WRAPPER2(name,type1,type2) \
typedef void (*name ## _t)(JNIEnv *, jclass, type1 one, type2 two); \
static name ## _t f_ ## name; \
@ -237,6 +255,15 @@ Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc, type1 one
f_ ## name(jenv, jc, one, two); \
}
#define SHELL_WRAPPER2_WITH_RETURN(name, return_type, type1, type2) \
typedef return_type (*name ## _t)(JNIEnv *, jclass, type1 one, type2 two); \
static name ## _t f_ ## name; \
extern "C" NS_EXPORT return_type JNICALL \
Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc, type1 one, type2 two) \
{ \
return f_ ## name(jenv, jc, one, two); \
}
#define SHELL_WRAPPER3(name,type1,type2,type3) \
typedef void (*name ## _t)(JNIEnv *, jclass, type1 one, type2 two, type3 three); \
static name ## _t f_ ## name; \
@ -246,6 +273,15 @@ Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc, type1 one
f_ ## name(jenv, jc, one, two, three); \
}
#define SHELL_WRAPPER3_WITH_RETURN(name, return_type, type1, type2, type3) \
typedef return_type (*name ## _t)(JNIEnv *, jclass, type1 one, type2 two, type3 three); \
static name ## _t f_ ## name; \
extern "C" NS_EXPORT return_type JNICALL \
Java_org_mozilla_gecko_GeckoAppShell_ ## name(JNIEnv *jenv, jclass jc, type1 one, type2 two, type3 three) \
{ \
return f_ ## name(jenv, jc, one, two, three); \
}
SHELL_WRAPPER0(nativeInit)
SHELL_WRAPPER1(nativeRun, jstring)
SHELL_WRAPPER1(notifyGeckoOfEvent, jobject)