Mojo function
platform_map
platform_map[T: Copyable & Movable, //, operation: Optional[String] = None, *, linux: Optional[T] = None, macos: Optional[T] = None]() -> T
Helper for defining a compile time value depending on the current compilation target, raising a compilation error if trying to access the value on an unsupported target.
Example:
alias EDEADLK = platform_alias["EDEADLK", linux=35, macos=11]()Parameters:
- βT (
Copyable&Movable): The type of the platform-specific value. - βoperation (
Optional): Optional operation name for error messages. - βlinux (
Optional): The value to use on Linux platforms. - βmacos (
Optional): The value to use on macOS platforms.
Returns:
T: The platform-specific value for the current target.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!