diff options
author | Sven Gothel <[email protected]> | 2021-08-31 22:37:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-08-31 22:37:47 +0200 |
commit | b333478f163179fa9737d17ee30bc7d316f3de27 (patch) | |
tree | 10d16886e79e96b187ae599be3d753d547211dab /java/jni | |
parent | 7ca6fea44262586d46e17efadbf268d17e242fd2 (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.cxx | 17 |
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); |