Commit 7941eec4 authored by Jon McClung's avatar Jon McClung Committed by Xianwen Chen

Provides Clang Compatibility (#378)

* Provides compatibility for clang

Without this, clang will treat it as an error that `jniDefaultSetPendingFromCurrent` could potentially throw an uncaught exception.

* Update djinni_support.cpp

typo

* Renamed function and added comment for rationale.

* Whitespace for proper alignment

* Check for Duplicate Output Paths

This adds some simple logic to check whether files are set to overwrite each other. This is especially helpful for newcomers who are confused when the default settings cause this issue.

* Revert "Check for Duplicate Output Paths"

This reverts commit 06441f47e0e8685b48ac3a5ddcf743a6315433d2.
parent 776207cf
......@@ -585,7 +585,7 @@ void jniSetPendingFromCurrent(JNIEnv * env, const char * ctx) noexcept {
jniDefaultSetPendingFromCurrent(env, ctx);
}
void jniDefaultSetPendingFromCurrent(JNIEnv * env, const char * /*ctx*/) noexcept {
void jniDefaultSetPendingFromCurrentImpl(JNIEnv * env) {
assert(env);
try {
throw;
......@@ -595,9 +595,17 @@ void jniDefaultSetPendingFromCurrent(JNIEnv * env, const char * /*ctx*/) noexcep
} catch (const std::exception & e) {
env->ThrowNew(env->FindClass("java/lang/RuntimeException"), e.what());
}
}
void jniDefaultSetPendingFromCurrent(JNIEnv * env, const char * /*ctx*/) noexcept {
/* It is necessary to go through a layer of indirection here because this
function is marked noexcept, but the implementation may still throw.
Any exceptions which are not caught (i.e. exceptions which aren't
std::exception subclasses) will result in a call to terminate() since this
function is marked noexcept */
// noexcept will call terminate() for anything not caught above (i.e.
// exceptions which aren't std::exception subclasses).
jniDefaultSetPendingFromCurrentImpl(env);
}
template class ProxyCache<JavaProxyCacheTraits>;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment