From 2d474e91e49c7343d28198eff2b5bbbed9afbcee Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 10 Jun 2026 02:41:34 +0900 Subject: feat(phase-c): resolve cross-module phase-b TODOs --- crates/shirabe-php-shim/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates/shirabe-php-shim') 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, +}; -- cgit v1.3.1