fn enable_libc() {
    const NO_ARCH: &'static [&'static str] = &["wasm32", "windows"];
    const NO_ENV: &'static [&'static str] = &["sgx"];

    if !is_feature_set("LIBC") {
        return;
    }

    let arch = match env::var("CARGO_CFG_TARGET_ARCH") {
        Err(_) => return,
        Ok(arch) => arch,
    };
    let env = match env::var("CARGO_CFG_TARGET_ENV") {
        Err(_) => return,
        Ok(env) => env,
    };
    if NO_ARCH.contains(&&*arch) || NO_ENV.contains(&&*env) {
        return;
    }

    println!("cargo:rustc-cfg=memchr_libc");
}
// This adds a `memchr_libc` cfg if and only if libc can be used, if no other
// better option is available.
//
// This could be performed in the source code, but it's simpler to do it once
// here and consolidate it into one cfg knob.
//
// Basically, we use libc only if its enabled and if we aren't targeting a
// known bad platform. For example, wasm32 doesn't have a libc and the
// performance of memchr on Windows is seemingly worse than the fallback
// implementation.
This adds a `memchr_libc` cfg if and only if libc can be used, if no other
better option is available.

This could be performed in the source code, but it's simpler to do it once
here and consolidate it into one cfg knob.

Basically, we use libc only if its enabled and if we aren't targeting a
known bad platform. For example, wasm32 doesn't have a libc and the
performance of memchr on Windows is seemingly worse than the fallback
implementation.
This adds a ` memchr_libc ` cfg if and only if libc can be used if no other better option is available . This could be performed in the source code but it ' s simpler to do it once here and consolidate it into one cfg knob . Basically we use libc only if its enabled and if we aren ' t targeting a known bad platform . For example wasm32 doesn ' t have a libc and the performance of memchr on Windows is seemingly worse than the fallback implementation .
fn enable_libc() {
    const NO_ARCH: &'static [&'static str] = &["wasm32", "windows"];
    const NO_ENV: &'static [&'static str] = &["sgx"];
    if !is_feature_set("LIBC") {
        return;
    }
    let arch = match env::var("CARGO_CFG_TARGET_ARCH") {
        Err(_) => return,
        Ok(arch) => arch,
    };
    let env = match env::var("CARGO_CFG_TARGET_ENV") {
        Err(_) => return,
        Ok(env) => env,
    };
    if NO_ARCH.contains(&&*arch) || NO_ENV.contains(&&*env) {
        return;
    }
    println!("cargo:rustc-cfg=memchr_libc");
}
fn enable_libc ( ) { const NO_ARCH : & ' static [ & ' static str ] = & [ " " , " " ] ; const NO_ENV : & ' static [ & ' static str ] = & [ " " ] ; if ! is_feature_set ( " " ) { return ; } let arch = match env :: var ( " " ) { Err ( _ ) => return , Ok ( arch ) => arch , } ; let env = match env :: var ( " " ) { Err ( _ ) => return , Ok ( env ) => env , } ; if NO_ARCH . contains ( & & * arch ) || NO_ENV . contains ( & & * env ) { return ; } println ! ( " " ) ; }
This adds a `memchr_libc` cfg if and only if libc can be used, if no other
better option is available.
This adds a ` memchr_libc ` cfg if and only if libc can be used if no other better option is available .