Use :windows to specify the window's branch inclusion. Use :macosx for Macs, and :unix for Unix. All are optional.

Use else to specify non-platform specific includes. If the else branch exists, it must be the last branch.

Conditional Provide

There are also os-dependent provide statements, provided to mirror the require statements (even though it's probably less likely to be used).

provide/windows evals to provide on Windows

provide/macosx evals to provide on Macs

provide/unix evals to provide on Unix

provide/os has the same structure has require/os - use :windows, :macosx, and :unix to write OS-dependent provide branch, and use else to write OS independent branch. If the else branch exists it must be the last branch

Both the require/* and provide/* behaves the same as regular require and provide in that they can only be called at top level or module level (provide only works at module level).

Conditional Expressions

The most general form is conditional expressions, which can be called at any position.

For windows, use +:windows:

(+:windows <exp> <exp2>) evaluates to <exp>, and <exp2> otherwise.

(+:windows <exp>) evaluates to <exp>, and (void) otherwise. It is equivalent to (+:windows <exp> (void)).

For Macs, use +:macosx in the same way as above. For Unix, use +:unix.

If you need to write more than 2 OS branch, use +:os, which is the foundation of all above macros:

(+:os (:windows exp) (:macosx exp) (:unix exp) (else exp))

Similar to require/os and provide/os, one of the branches with labels of :windows, :macosx and :unix get evaluated for the respective OS. The else branch is evaluated for platform independent expression; and if it exists it must be the last expression.