Skip to content
Snippets Groups Projects
Verified Commit e32fc123 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Weak linkage for getopt and fnmatch

parent c6f2b307
No related branches found
No related tags found
No related merge requests found
Pipeline #1766 passed with warnings
......@@ -118,6 +118,7 @@ unsafe fn tokenize(mut pattern: *const u8, flags: c_int) -> Vec<(Token, Range)>
}
#[no_mangle]
#[linkage = "weak"] // often redefined in GNU programs
pub unsafe extern "C" fn fnmatch(pattern: *const c_char, input: *const c_char, flags: c_int) -> c_int {
let mut len = 0;
while *input.offset(len) != 0 {
......
......@@ -20,6 +20,7 @@ pub struct option {
}
#[no_mangle]
#[linkage = "weak"] // often redefined in GNU programs
pub unsafe extern "C" fn getopt_long(
argc: c_int,
argv: *const *mut c_char,
......
......@@ -7,21 +7,26 @@ use platform::types::*;
#[allow(non_upper_case_globals)]
#[no_mangle]
#[linkage = "weak"] // often redefined in GNU programs
pub static mut optarg: *mut c_char = ptr::null_mut();
#[allow(non_upper_case_globals)]
#[no_mangle]
#[linkage = "weak"] // often redefined in GNU programs
pub static mut optind: c_int = 1;
#[allow(non_upper_case_globals)]
#[no_mangle]
#[linkage = "weak"] // often redefined in GNU programs
pub static mut opterr: c_int = 1;
#[allow(non_upper_case_globals)]
#[no_mangle]
#[linkage = "weak"] // often redefined in GNU programs
pub static mut optopt: c_int = -1;
#[no_mangle]
#[linkage = "weak"] // often redefined in GNU programs
pub unsafe extern "C" fn getopt(
argc: c_int,
argv: *const *mut c_char,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment