-
Notifications
You must be signed in to change notification settings - Fork 109
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
Android glue #13
Merged
+1,922
−13,897
Merged
Android glue #13
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8e8b8f7
Make native-app-glue optional.
dvc94ch e9349a3
Link against libandroid.so
dvc94ch 52c80a6
Add some missing functions.
dvc94ch 77f5f3f
Remove unnecessary armv7 bindings.
dvc94ch 0e179c8
Android glue.
dvc94ch 4c0dc7b
Add android-build-tools.
dvc94ch 6b63fd1
Add cargo-apk.
dvc94ch af677c1
Add android-examples.
dvc94ch afc01d7
Remove native-app-glue support.
dvc94ch 21d1401
Update ci.
dvc94ch 36d81dc
Update README.
dvc94ch 371f6d4
Support test and doc commands.
dvc94ch a5c2576
Rename everything.
dvc94ch 49b3110
Add ndk_glue macro.
dvc94ch 3d8e2b7
Update cargo-subcommand.
dvc94ch e78acbb
Update README.
dvc94ch f0f79fa
Fix panic on exit.
dvc94ch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
#[cfg(target_os = "android")] | ||
#[no_mangle] | ||
pub unsafe extern "C" fn ANativeActivity_onCreate( | ||
activity: *mut std::os::raw::c_void, | ||
saved_state: *mut std::os::raw::c_void, | ||
saved_state_size: usize, | ||
) { | ||
std::env::set_var("RUST_BACKTRACE", "1"); | ||
ndk_glue::init( | ||
activity as _, | ||
saved_state as _, | ||
saved_state_size as _, | ||
app_main, | ||
); | ||
} | ||
ndk_glue::ndk_glue!(main); | ||
|
||
pub fn app_main() { | ||
fn main() { | ||
println!("hello world"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be it will the better to implement proc_macro instead.
So using attribute macros the usage may looks like the follow:
For example you can see cortex-m-rt entry macro implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that may be a good improvement, but I'm getting some PR fatigue, can we leave it for a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, don't worry :)