Skip to content

Comments

jextract/jni: Always return (U)Int as long#564

Merged
ktoso merged 3 commits intoswiftlang:mainfrom
madsodgaard:fix-32-bit-returning-nit
Feb 16, 2026
Merged

jextract/jni: Always return (U)Int as long#564
ktoso merged 3 commits intoswiftlang:mainfrom
madsodgaard:fix-32-bit-returning-nit

Conversation

@madsodgaard
Copy link
Contributor

@madsodgaard madsodgaard commented Feb 16, 2026

Previously functions returning Int would not compile on 32-bit platforms, because we just used getJNIValue which maps to Java int on 32-bit platforms.

This PR just puts the returning Int through Int64 or UInt64 initializer to always get a long back, no matter the CPU architecture.

@madsodgaard madsodgaard requested a review from ktoso as a code owner February 16, 2026 14:58
@madsodgaard madsodgaard marked this pull request as draft February 16, 2026 14:58
@madsodgaard madsodgaard marked this pull request as ready for review February 16, 2026 20:11
@madsodgaard madsodgaard changed the title [WIP] fix returning Int on 32-bit jextract/jni: Always return (U)Int as long Feb 16, 2026
@ktoso ktoso merged commit c1007f7 into swiftlang:main Feb 16, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants