Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Java11 Fixes by ggmuelle #133

Merged
merged 2 commits into from
Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ all:
echo "Please specify a system: windows wine linux osx"
gradle build
windows:
make -C .\src\main\c windowsLocal
mingw32-make -C .\src\main\c windowsLocal
gradle build
wine:
make -C src/main/c windows
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ After the native code is built, the JAR is rebuilt.

You'll need some installation of GCC. We recommend the
[TDM-GCC](http://tdm-gcc.tdragon.net/) distribution of mingw64-w64.
To get the build working you need both mingw32, and ming64 installed in separate directories.
Please modify JDKDIR to your installation of jdk.

## Building on OS X

Expand Down
2 changes: 1 addition & 1 deletion src/main/c/include/SerialImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ int translate_parity( JNIEnv *, tcflag_t *, jint );
void system_wait();
void finalize_event_info_struct( struct event_info_struct * );
int read_byte_array( JNIEnv *, jobject *, int, unsigned char *, int, int );
long get_java_var_long( JNIEnv *, jobject, char *, char * );
size_t get_java_var_long( JNIEnv *, jobject, char *, char * );
size_t get_java_var( JNIEnv *, jobject, char *, char * );
jboolean is_interrupted( struct event_info_struct * );
int send_event(struct event_info_struct *, jint, int );
Expand Down
6 changes: 3 additions & 3 deletions src/main/c/src/SerialImp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5075,9 +5075,9 @@ size_t get_java_var( JNIEnv *env, jobject jobj, char *id, char *type ) {
return (size_t) get_java_var_long( env, jobj, id, type );
}

long get_java_var_long( JNIEnv *env, jobject jobj, char *id, char *type )
size_t get_java_var_long( JNIEnv *env, jobject jobj, char *id, char *type )
{
long result = 0;
size_t result = 0;
jclass jclazz = (*env)->GetObjectClass( env, jobj );
jfieldID jfd = (*env)->GetFieldID( env, jclazz, id, type );

Expand All @@ -5092,7 +5092,7 @@ long get_java_var_long( JNIEnv *env, jobject jobj, char *id, char *type )
return result;
}
if ( !strcmp( type, "J" ) ) {
result = (long)( (*env)->GetLongField( env, jobj, jfd ) );
result = (size_t)( (*env)->GetLongField( env, jobj, jfd ) );
} else {
result = (size_t) ( (*env)->GetIntField( env, jobj, jfd ) );
}
Expand Down