Skip to main content

preprocess_with

Function preprocess_with 

Source
pub fn preprocess_with(
    path: &str,
    source: &str,
    loader: &dyn FileLoader,
    defines: &[(String, String)],
) -> Preprocessed
Expand description

As preprocess, with macros the caller defined.

defines is what a build system passes as -D: each entry is a name and its body, and an empty body is -DNAME — defined, expanding to nothing, which is what #ifdef asks about. They are in place before the first line is read, so a #ifndef guard at the top of the unit sees them. A name written NAME(a, b) defines a function-like macro.