mirror of
https://github.com/corda/corda.git
synced 2025-06-17 22:58:19 +00:00
quick sketches of various SWT 3.3 dependencies
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
#include "time.h"
|
||||
#include "time.h"
|
||||
#include "string.h"
|
||||
#include "stdio.h"
|
||||
#include "jni.h"
|
||||
#include "jni-util.h"
|
||||
|
||||
@ -37,3 +38,20 @@ Java_java_lang_System_currentTimeMillis(JNIEnv*, jclass)
|
||||
return (static_cast<jlong>(tv.tv_sec) * 1000) +
|
||||
(static_cast<jlong>(tv.tv_usec) / 1000);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jstring JNICALL
|
||||
Java_java_lang_System_doMapLibraryName(JNIEnv* e, jclass, jstring name)
|
||||
{
|
||||
jstring r = 0;
|
||||
const char* chars = e->GetStringUTFChars(name, 0);
|
||||
if (chars) {
|
||||
unsigned nameLength = strlen(chars);
|
||||
unsigned size = nameLength + 7;
|
||||
char buffer[size];
|
||||
snprintf(buffer, size, "lib%s.so", chars);
|
||||
r = e->NewStringUTF(buffer);
|
||||
|
||||
e->ReleaseStringUTFChars(name, chars);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
Reference in New Issue
Block a user