am e0f789dc: Merge "Remove dead code: jniGetStackTrace."
* commit 'e0f789dcfc4ff18127fa00a6f99c5236c2e27eed':
Remove dead code: jniGetStackTrace.
diff --git a/JNIHelp.cpp b/JNIHelp.cpp
index 4b77680..7fc166a 100644
--- a/JNIHelp.cpp
+++ b/JNIHelp.cpp
@@ -256,12 +256,7 @@
return jniThrowException(env, "java/io/IOException", message);
}
-void jniLogException(C_JNIEnv* env, int priority, const char* tag, jthrowable exception) {
- std::string trace(jniGetStackTrace(env, exception));
- __android_log_write(priority, tag, trace.c_str());
-}
-
-extern "C" std::string jniGetStackTrace(C_JNIEnv* env, jthrowable exception) {
+static std::string jniGetStackTrace(C_JNIEnv* env, jthrowable exception) {
JNIEnv* e = reinterpret_cast<JNIEnv*>(env);
scoped_local_ref<jthrowable> currentException(env, (*env)->ExceptionOccurred(e));
@@ -289,6 +284,11 @@
return trace;
}
+void jniLogException(C_JNIEnv* env, int priority, const char* tag, jthrowable exception) {
+ std::string trace(jniGetStackTrace(env, exception));
+ __android_log_write(priority, tag, trace.c_str());
+}
+
const char* jniStrError(int errnum, char* buf, size_t buflen) {
// Note: glibc has a nonstandard strerror_r that returns char* rather than POSIX's int.
// char *strerror_r(int errnum, char *buf, size_t n);
diff --git a/include/nativehelper/JNIHelp.h b/include/nativehelper/JNIHelp.h
index 8a630fe..b413fe9 100644
--- a/include/nativehelper/JNIHelp.h
+++ b/include/nativehelper/JNIHelp.h
@@ -33,12 +33,6 @@
# define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0])))
#endif
-// TODO: the build system doesn't ensure the standard C++ library header files are on the include
-// path when compiling C++, and this file is included all over the place.
-#ifdef LIBCORE_CPP_JNI_HELPERS
-#include <string>
-#endif // LIBCORE_CPP_JNI_HELPERS
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -178,16 +172,6 @@
jniLogException(&env->functions, priority, tag, exception);
}
-#ifdef LIBCORE_CPP_JNI_HELPERS
-
-extern "C" std::string jniGetStackTrace(C_JNIEnv* env, jthrowable exception);
-
-inline std::string jniGetStackTrace(JNIEnv* env, jthrowable exception = NULL) {
- return jniGetStackTrace(&env->functions, exception);
-}
-
-#endif // LIBCORE_CPP_JNI_HELPERS
-
#endif
/* Logging macros.