Skip to content

Commit

Permalink
Merge pull request #133 from irfman12/java11
Browse files Browse the repository at this point in the history
Added Java11 Fixes by ggmuelle
  • Loading branch information
madhephaestus committed Dec 5, 2018
2 parents 905f0cf + fa8e5d2 commit a190730
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
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

0 comments on commit a190730

Please sign in to comment.