diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-10 02:41:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-10 02:46:18 +0900 |
| commit | 2d474e91e49c7343d28198eff2b5bbbed9afbcee (patch) | |
| tree | 8c1ab321dfa5ddc1ca9d2871eb06a6fde6b2970b /crates/shirabe-php-shim | |
| parent | e583112899cbea7494ffdd73d7de380dd5f808c4 (diff) | |
| download | php-shirabe-2d474e91e49c7343d28198eff2b5bbbed9afbcee.tar.gz php-shirabe-2d474e91e49c7343d28198eff2b5bbbed9afbcee.tar.zst php-shirabe-2d474e91e49c7343d28198eff2b5bbbed9afbcee.zip | |
feat(phase-c): resolve cross-module phase-b TODOs
Diffstat (limited to 'crates/shirabe-php-shim')
| -rw-r--r-- | crates/shirabe-php-shim/src/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index f47e221..873f7f4 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -2477,3 +2477,16 @@ pub fn date_format_to_strftime(format: &str) -> &'static str { other => panic!("Unsupported PHP date format: {other:?}"), } } + +// NOTE: &str matching in const expression does not compile for now. +pub const PHP_OS: &str = match std::env::consts::OS.as_bytes() { + b"linux" => "Linux", + b"macos" => "Darwin", + b"windows" => "WINNT", + b"freebsd" => "FreeBSD", + b"openbsd" => "OpenBSD", + b"netbsd" => "NetBSD", + b"dragonfly" => "DragonFly", + b"solaris" | b"illumos" => "SunOS", + _ => std::env::consts::OS, +}; |
