Surface rename of the signed integer family: s1..s64 become i1..i64
(u1..u64, usize, isize unchanged). 'string' keeps the s-prefix arm in
name classification; width parsing moves to the i-prefix arm next to
isize.
Internal TypeId tags follow the surface (.s8/.s16/.s32/.s64 ->
.i8/.i16/.i32/.i64), as do mono-key mangle fragments (ptr_i64,
tu_i64_bool) and all display/diagnostic formatting (i{d}).
Migrated in the same sweep: stdlib + examples + issue repros + FFI C
companions (shared symbol names like ffi_id_i64), expected
stdout/stderr/ir snapshots, specs.md, readme.md, CLAUDE.md/AGENTS.md,
implementation_plan.md, docs/, issue writeups. Vendored stb_image and
historical flow state left untouched.
zig build test: 426/426; examples suite: 595/595.
32 lines
1.4 KiB
Plaintext
32 lines
1.4 KiB
Plaintext
// `#jni_main` pipeline slice 2 (PLAN-FFI.md): the compiler renders a
|
|
// `.java` source for a `#jni_main #jni_class("...")` declaration, runs
|
|
// `javac` + `d8`, and bundles `classes.dex` into the APK.
|
|
//
|
|
// Slice 2 only wires the plumbing — the manifest still points at
|
|
// `android.app.NativeActivity`, so the user's class isn't loaded at
|
|
// runtime. Slice 3 (manifest synthesis) and slice 4 (RegisterNatives)
|
|
// land in follow-up commits.
|
|
//
|
|
// Build to inspect APK contents (requires Android SDK + JDK):
|
|
// /Users/agra/projects/sx/zig-out/bin/sx build --target android \
|
|
// --apk /tmp/sxjnimain.apk --bundle-id co.swipelab.sxjnimain \
|
|
// -o /tmp/libsxjnimain.so examples/ffi-jni-main-01-emit.sx
|
|
// unzip -l /tmp/sxjnimain.apk | grep classes.dex
|
|
|
|
#import "modules/std.sx";
|
|
#import "modules/build.sx";
|
|
|
|
// `*Bundle` resolves through the class registry to `android.os.Bundle`
|
|
// in the emitted Java — needed for `onCreate`'s @Override to match
|
|
// NativeActivity's superclass signature.
|
|
Bundle :: #foreign #jni_class("android/os/Bundle") { }
|
|
|
|
// `#jni_main` flags this as the launchable Android Activity class. The
|
|
// `onCreate` body is empty for now — slice 4 wires `RegisterNatives`
|
|
// so the `sx_onCreate` native delegate actually binds to a sx-side fn.
|
|
SxApp :: #jni_main #jni_class("co/swipelab/sxjnimain/SxApp") {
|
|
onCreate :: (self: *Self, b: *Bundle) { }
|
|
}
|
|
|
|
main :: () -> i32 { 0 }
|