-
Notifications
You must be signed in to change notification settings - Fork 207
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
Aggregate libc functions into one file. #1050
Comments
Ideally these would just import from // b.c
use ::libc::printf;
#[no_mangle]
pub unsafe extern "C" fn funB(mut n: libc::c_int) -> libc::c_int {
printf(b"funB\0" as *const u8 as *const libc::c_char);
return n;
}
// a.rs
use ::libc::{printf, puts};
#[no_mangle]
pub unsafe extern "C" fn funA(mut n: libc::c_int) -> libc::c_int {
puts(b"funA\0" as *const u8 as *const libc::c_char);
printf(b"funA\0" as *const u8 as *const libc::c_char);
return n;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, libc functions are individually imported in each file. If there is a need to replace a particular function, modifications are required in all files using it. Consolidating all libc functions into one file would require modifications only in that file for any changes.
The text was updated successfully, but these errors were encountered: