aboutsummaryrefslogtreecommitdiffstats
path: root/java/jni
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-08-31 22:37:47 +0200
committerSven Gothel <[email protected]>2021-08-31 22:37:47 +0200
commitb333478f163179fa9737d17ee30bc7d316f3de27 (patch)
tree10d16886e79e96b187ae599be3d753d547211dab /java/jni
parent7ca6fea44262586d46e17efadbf268d17e242fd2 (diff)
Properly expose runtime version C++ (DIRECT_BT_VERSION etc) and Java via BTFactory
Diffstat (limited to 'java/jni')
-rw-r--r--java/jni/BTFactory.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/java/jni/BTFactory.cxx b/java/jni/BTFactory.cxx
index ace0a6b3..3be7d34c 100644
--- a/java/jni/BTFactory.cxx
+++ b/java/jni/BTFactory.cxx
@@ -25,18 +25,31 @@
#include "org_direct_bt_BTFactory.h"
-#include "version.h"
+#include <direct_bt/version.h>
#include "helper_base.hpp"
using namespace jau;
+jstring Java_org_direct_1bt_BTFactory_getNativeVersion(JNIEnv *env, jclass clazz)
+{
+ try {
+ (void) clazz;
+
+ std::string api_version = std::string(DIRECT_BT_VERSION);
+ return env->NewStringUTF(api_version.c_str());
+ } catch(...) {
+ rethrow_and_raise_java_exception(env);
+ }
+ return nullptr;
+}
+
jstring Java_org_direct_1bt_BTFactory_getNativeAPIVersion(JNIEnv *env, jclass clazz)
{
try {
(void) clazz;
- std::string api_version = std::string(gVERSION_API);
+ std::string api_version = std::string(DIRECT_BT_VERSION_API);
return env->NewStringUTF(api_version.c_str());
} catch(...) {
rethrow_and_raise_java_exception(env);