Skip to content

Commit

Permalink
fix(dyncall): invalid handling of 64-bit integers on 32-bit architect…
Browse files Browse the repository at this point in the history
…ures
  • Loading branch information
Spasi committed May 8, 2017
1 parent d19afa2 commit 26459f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/notes/3.1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ This build includes the following changes:
- OpenAL: Removed buffer auto-sizing from `alcCaptureSamples`. The number of samples must now be specified explicitly, similar to `alcRenderSamplesSOFT`.
- Vulkan: Function addresses are now retrieved only once, using the optimal method for each function type.
* This avoids warnings on pedantic validation layers.
- Fixed callback invocation bugs on 32-bit architectures.

### Breaking Changes

Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/main/c/system/org_lwjgl_system_Callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static char cbHandlerV(DCCallback *cb, DCArgs *args, DCValue *result, void *user
(*env)->CallVoidMethod(env,
(jobject)userdata,
javaCallbackV,
args
(jlong)(intptr_t)args
);

// Check for exception
Expand All @@ -69,7 +69,7 @@ static char cbHandlerV(DCCallback *cb, DCArgs *args, DCValue *result, void *user
*(Type*)result = (Type)(*env)->Call##JavaType##Method(env, \
(jobject)userdata, \
javaCallback##Name, \
args \
(jlong)(intptr_t)args \
); \
\
if ( (*env)->ExceptionCheck(env) && async ) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ class CallbackFunction(
private val NativeType.argType
get() = if (this is PointerType || mapping === PrimitiveMapping.POINTER)
"Pointer"
else if (mapping == PrimitiveMapping.BOOLEAN)
else if (mapping === PrimitiveMapping.BOOLEAN)
"Bool"
else if (mapping === PrimitiveMapping.LONG)
"LongLong"
else
(mapping as PrimitiveMapping).javaMethodName.upperCaseFirst

Expand Down

0 comments on commit 26459f7

Please sign in to comment.