2007-08-27 13:46:17 +00:00
|
|
|
#ifndef JNI_UTIL
|
|
|
|
#define JNI_UTIL
|
|
|
|
|
2007-10-27 00:20:37 +00:00
|
|
|
#undef JNIEXPORT
|
|
|
|
#ifdef __MINGW32__
|
|
|
|
# define JNIEXPORT __declspec(dllexport)
|
|
|
|
#else
|
2007-11-01 20:06:26 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
# define JNIEXPORT __attribute__ ((used))
|
|
|
|
#else
|
2007-10-27 00:20:37 +00:00
|
|
|
# define JNIEXPORT __attribute__ ((visibility("default")))
|
|
|
|
#endif
|
2007-11-01 20:06:26 +00:00
|
|
|
#endif
|
2007-10-27 00:20:37 +00:00
|
|
|
|
2007-08-27 13:46:17 +00:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
inline void
|
|
|
|
throwNew(JNIEnv* e, const char* class_, const char* message)
|
|
|
|
{
|
|
|
|
jclass c = e->FindClass(class_);
|
|
|
|
if (c) {
|
|
|
|
e->ThrowNew(c, message);
|
|
|
|
e->DeleteLocalRef(c);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif//JNI_UTIL
|