Remove weak linkage from getopt functions and globals

This commit is contained in:
Jeremy Soller
2025-10-30 14:39:27 -06:00
parent ab2a948d0b
commit a33bb699e6
2 changed files with 0 additions and 6 deletions
-1
View File
@@ -26,7 +26,6 @@ pub struct option {
}
#[unsafe(no_mangle)]
#[linkage = "weak"] // often redefined in GNU programs
pub unsafe extern "C" fn getopt_long(
argc: c_int,
argv: *const *mut c_char,
-5
View File
@@ -7,30 +7,25 @@ use crate::{header::getopt, platform::types::*};
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/getopt.html>.
#[allow(non_upper_case_globals)]
#[unsafe(no_mangle)]
#[linkage = "weak"] // often redefined in GNU programs
pub static mut optarg: *mut c_char = ptr::null_mut();
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/getopt.html>.
#[allow(non_upper_case_globals)]
#[unsafe(no_mangle)]
#[linkage = "weak"] // often redefined in GNU programs
pub static mut opterr: c_int = 1;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/getopt.html>.
#[allow(non_upper_case_globals)]
#[unsafe(no_mangle)]
#[linkage = "weak"] // often redefined in GNU programs
pub static mut optind: c_int = 1;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/getopt.html>.
#[allow(non_upper_case_globals)]
#[unsafe(no_mangle)]
#[linkage = "weak"] // often redefined in GNU programs
pub static mut optopt: c_int = -1;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/getopt.html>.
#[unsafe(no_mangle)]
#[linkage = "weak"] // often redefined in GNU programs
pub unsafe extern "C" fn getopt(
argc: c_int,
argv: *const *mut c_char,